一個(gè)固定高度的行,通常包含一些文本,以及一個(gè)行前或行尾圖標(biāo)。
構(gòu)造方法
const ListTile({
Key key,
this.leading,
this.title,
this.subtitle,
this.trailing,
this.isThreeLine = false,
this.dense,
this.contentPadding,
this.enabled = true,
this.onTap,
this.onLongPress,
this.selected = false,
})
1.leading
最左側(cè)的頭部,參數(shù)是一個(gè)widget,(這里以icon為例)
new ListTile(
leading: new Icon(Icons.cake),
)

leading.png
2.title
控件的title(參數(shù)是widget,這里text為例)
new ListTile(
leading: new Icon(Icons.cake),
title: new Text('標(biāo)題'),
)

title.png
3.subtitle
富文本標(biāo)題(參數(shù)是widget)
new ListTile(
leading: new Icon(Icons.cake),
title: new Text('標(biāo)題'),
subtitle: new Row(
children: <Widget>[
new Text('副標(biāo)題'),
new Icon(Icons.person)
],
),
)

subtitle.png
4.trailing
展示在title后面最末尾的后綴組件(參數(shù)是widget)
new ListTile(
leading: new Icon(Icons.cake),
title: new Text('標(biāo)題'),
subtitle: new Row(
children: <Widget>[
new Text('副標(biāo)題'),
new Icon(Icons.person)
],
),
trailing: new Icon(Icons.save),
)

trailing.png
5.onTap
點(diǎn)擊事件
onTap: () {
print('點(diǎn)擊');
},
其他方法類型 不做介紹