我正在使用ExpansionPanel
创建自己的自定义CustomExpansionPanelList
小部件。该面板的标题中包含一个按钮。
赞:
return new ExpansionPanel(
headerBuilder: (BuildContext context, bool isExpanded) {
return new Container(
child: new Row(
children: <Widget>[
Icon(
CustomFont.security_1,
color: Colors.white,
),
new Padding(
padding: EdgeInsets.only(
left: 5.0,
right: 5.0
),
child: Text(
i.name,
style: TextStyle(
color: Colors.white
),
),
),
new Spacer(),
new IconButton(
icon: new Icon(
CustomFont.tick_2,
color: Colors.white,
),
onPressed: () {
setState(() {
//here when clicked i want to change the color of the current header's panel
});
}),
],
),
);
},
按下该按钮时,我想更改当前索引的标题颜色。
我该怎么做?