Tar*_*iAg 8 flutter flutter-design
keyboard_down_arrow我需要更改尾随的颜色ExpansionTile。我尝试将它包装在主题小部件中并设置重音、主要和图标主题,但似乎没有任何效果。
Theme(
data: Theme.of(context).copyWith(
dividerColor: Colors.transparent,
accentColor: Colors.black,
),
child: ExpansionTile(
//
title: Text("Some Text"
),
childrenPadding: EdgeInsets.symmetric(horizontal: 15),
children: [
],
),
),
Run Code Online (Sandbox Code Playgroud)
小智 17
我有具有打开/关闭状态的最新解决方案:
Theme(
data: Theme.of(context).copyWith(
unselectedWidgetColor: Colors.white, // here for close state
colorScheme: ColorScheme.light(
primary: Colors.white,
), // here for open state in replacement of deprecated accentColor
dividerColor: Colors.transparent, // if you want to remove the border
),
child: ExpansionTile(
...
),
),...
Run Code Online (Sandbox Code Playgroud)
要更改尾随图标颜色,您可以使用扩展图块中的以下参数
trailing: Icon(
Icons.keyboard_arrow_down,
color: Colors.green,
),
Run Code Online (Sandbox Code Playgroud)
例子:
ExpansionTile(
//
title: Text("Some Text"),
trailing: Icon(
Icons.keyboard_arrow_down,
color: Colors.green,
),
),
Run Code Online (Sandbox Code Playgroud)
以及主题颜色的使用color: Theme.of(context).primaryColor,
| 归档时间: |
|
| 查看次数: |
20412 次 |
| 最近记录: |