我试图在 ListView 之后使用 ListTileStyle
ListView(
ListTileStyle(),
Children:<widget>[
ListTile(),
ListTile(),
ListTile(),
]
),
Run Code Online (Sandbox Code Playgroud)
但不能使用 ListTile 的任何属性。任何人都可以解释 ListTileStyle 是如何工作的。
当 Material 按钮被禁用时,我试图显示不同的颜色。我正在添加属性 disabledColor 和 disabledTextColor。但是, disabledTextColor 显示输入的确切颜色,但 disabledColor 不显示任何颜色。
这是我的代码
disabledColor:Colors.grey, // 不适用于按钮的背景颜色 disabledTextColor:Colors.black, // 适用于按钮的文本颜色
MaterialButton(
padding: EdgeInsets.all(10.0),
disabledElevation: 1,
disabledColor: Colors.black45,
disabledTextColor: Colors.white70,
color:Colors.indigo,
textColor: Colors.white,
child: Text("Verify",style: TextStyle(
fontSize: 18.0,
),),
onPressed: null,
),
Run Code Online (Sandbox Code Playgroud)
我希望输出应该显示灰色作为背景颜色和黑色作为文本颜色。
flutter ×2