【发布时间】:2021-08-21 11:28:01
【问题描述】:
在我的 Flutter 应用中,我有一个带圆角的 OutlinedButton:
OutlinedButton(
child: Text(
"a label",
),
onPressed: () {
// do something
},
style: OutlinedButton.styleFrom(
primary: Colors.white,
backgroundColor: MyColor.colorAccent,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
),
),
),
)
现在我需要为禁用状态设置按钮样式,但我不需要如何知道这个小部件(在 EevatedButton 上,我使用 MaterialStateProperty.resolveWith 作为背景颜色,但它不适合轮廓按钮)
【问题讨论】:
标签: flutter button flutter-widget