
微信交流群
# ExpansionTile
ExpansionTile 组件是分组组件,点击尾部的按钮打开/关闭子控件。
基本用法如下:
ExpansionTile(
title: Text('学科'),
children: <Widget>[
Text('英语'),
Text('数学'),
Text('语文')
],
)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
效果如下:
设置头部图标、子标题、背景颜色:
ExpansionTile(
leading: Icon(Icons.home),
subtitle: Text('各种学科'),
backgroundColor: Colors.greenAccent,
title: Text('学科'),
children: <Widget>[
Text('英语'),
Text('数学'),
Text('语文')
],
)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
效果如下:
initiallyExpanded
表示是否打开,用法如下:
ExpansionTile(
initiallyExpanded: true,
...
)
1
2
3
4
2
3
4
onExpansionChanged
打开/关闭回调:
ExpansionTile(
onExpansionChanged: (bool value) {},
...
)
1
2
3
4
2
3
4
版权所有,禁止私自转发、克隆网站。