flutter控件之---------listTile

一個(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)擊');
                },

其他方法類型 不做介紹

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 想著她清晰而又模糊了的面頰, 輾轉(zhuǎn)無(wú)眠,揮不去她如夜的黑發(fā)。 雞啼二遍催我睡吧,被愛(ài)俘虜?shù)男∩倒希?別再空結(jié)幽怨,...
    唯一還是我閱讀 251評(píng)論 0 0
  • 今天是元旦放假第一天,為了讓兒子多休息會(huì),七點(diǎn)了才叫床,兒子也很聽(tīng)活,穿好衣服,就開(kāi)始了每一天的早讀,看著...
    鈞宇閱讀 234評(píng)論 0 0
  • 我覺(jué)得,就事論事。這個(gè)事情就是投票規(guī)則漏洞問(wèn)題,上??梢酝镀睕Q定其他中區(qū)長(zhǎng)。Forrest雖然已經(jīng)加入南京頭馬,但...
    克克克阿閱讀 943評(píng)論 2 0

友情鏈接更多精彩內(nèi)容