flutter_ExpansionTile

const ExpansionTile({
    Key key,
    this.leading,
    @required this.title,
    this.backgroundColor,
    this.onExpansionChanged,
    this.children = const <Widget>[],
    this.trailing,
    this.initiallyExpanded = false,
  }) : assert(initiallyExpanded != null),
       super(key: key);

title:闭合时显示的标题,一般使用text widget
leading:标题左侧图标
backgroundColor: 展开时的背景颜色。
children: 子元素,是一个数组,可以放入多个元素。
trailing : 右侧的箭头,可以自行替换。
initiallyExpanded: 初始状态是否展开,为true时,是展开,默认为false,是不展开。

更改箭头【trailing】,将右侧箭头更改至左侧

leading: Icon(Icons.keyboard_arrow_down),
trailing: Icon(null),

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容