
微信交流群
# ExpandIcon
ExpandIcon是一个旋转展开/折叠按钮的组件。
基本用法如下:
bool _expanded = false;
return ExpandIcon(
onPressed: (value) {
setState(() {
_expanded = !_expanded;
});
},
isExpanded: _expanded,
);
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
效果如下:
点击时,向下的箭头旋转180度。
设置大小和颜色:
ExpandIcon(
size: 48,
color: Colors.blue,
...
)
1
2
3
4
5
2
3
4
5
效果如下:
设置禁用颜色和打开颜色:
ExpandIcon(
disabledColor: Colors.green,
expandedColor: Colors.blue,
color: Colors.red,
onPressed: (value) {
setState(() {
_expanded = !_expanded;
});
},
isExpanded: _expanded,
)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
效果如下:
color
:正常未打开状态箭头的颜色。
disabledColor
:禁用状态(onPressed = null)箭头的颜色。
expandedColor
:打开状态箭头的颜色。
版权所有,禁止私自转发、克隆网站。