【发布时间】:2019-10-14 09:47:09
【问题描述】:
在下面颤动的ExpansionPanelList 小部件中,我正在尝试将白色背景着色为其他颜色,例如indigo,我找不到任何文档或有用的链接来实现这一点
ExpansionPanelList(
expansionCallback: (int index, bool isExpanded) {
setState(() {
_categoryExpansionStateMap[_categoryExpansionStateMap.keys
.toList()[index]] = !isExpanded;
});
},
children: <ExpansionPanel>[
ExpansionPanel(
headerBuilder: (BuildContext context, bool isExpanded) {
return ListTile(
contentPadding: EdgeInsets.all(3.0),
leading: Container(
padding:
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
decoration: BoxDecoration(
border: Border(
left: BorderSide(
width: 3.0, color: Colors.white54))),
child: Icon(
Icons.account_circle,
size: 30.0,
color: Colors.black,
),
),
title: ListTile(
contentPadding: EdgeInsets.all(0.0),
title: Text(
Strings.yourBasicInformation,
style: TextStyle(
color: Colors.black,
fontSize: 14.0,),
)
),
);
},
body: Biography(),
isExpanded: _categoryExpansionStateMap["Biography"]),
],
),
【问题讨论】:
-
您是否尝试过将您的 ExpansionPanelTile 包装在一个容器中并在容器的颜色参数中传递颜色?