【发布时间】:2021-03-10 03:47:57
【问题描述】:
由于在 Flutter 2.0 中 RaisedButton 已更改为 ElevatedButton,我尝试为该按钮创建一个默认主题,但我不知道该怎么做。
这是我放在 main() 中的内容
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20))),
),
我收到以下错误
The argument type 'RoundedRectangleBorder' can't be assigned to the parameter type 'MaterialStateProperty<OutlinedBorder>'.
我不知道如何使用 MaterialStateProperty 参数,因为它没有给我任何关于如何使用它的线索。我阅读了文档,但没有关于此的示例。
有人知道吗?
【问题讨论】:
标签: flutter