簡體   English   中英

用卡片顫動修改的 ListTile 字幕

[英]ListTile subtitle modified with card flutter

我想讓標題和副標題與標題平行。 我將小部件放在副標題中,因為我想在其中放 2 個文本,但是我遇到了問題,副標題文本左側有空格。 我該怎么辦?

這是我的代碼

ListView.builder(
  itemCount: data == null ? 0 : data.length,
  itemBuilder: (BuildContext context, int index) {
    return Card(
      child: ListTile(
        leading: Icon(
          data[index]['is_started_scan'] ? Icons.check_circle : Icons.cancel,
          size: 50.0,
          color: data[index]['is_started_scan']
              ? Colors.greenAccent
              : Colors.redAccent,
        ),
        title: Text(data[index]['title']),
        subtitle: Container(
          child: (Column(
            children: <Widget>[
              Text(data[index]['time'], style: TextStyle(fontSize: 13)),
              Text(data[index]['venue_name'], style: TextStyle(fontSize: 12)),
            ],
          )),
        ),
        trailing: Icon(Icons.navigate_next),
        isThreeLine: true,
      ),
    );
  },
),

在你的副標題 => Container => child => Column 添加

crossAxisAlignment: CrossAxisAlignment.start

這是你問的嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM