gpt4 book ai didi

dart - 如何创建带有 2 个 Widget 的 Listtile?

转载 作者:IT王子 更新时间:2023-10-29 07:23:51 24 4
gpt4 key购买 nike

如何创建包含图像和复选框的前导小部件?

我尝试使用 Row Widget,但后来我的 listtile 变大了。

ListTile(
leading: Row(
children: <Widget>[
LoadImage(),
Checkbox(value: false, onChanged: null),öööö
],
),
title: Text(snapshot.data.documents[index]["Name"]),
subtitle: Text(snapshot.data.documents[index]["Status"]),
trailing: IconButton(
onPressed: (){
showDialog(
context: context,
builder: (_) {
return DialogSpielerLoeschen(
snapshot: snapshot,
index: index,
);
},
);
},
icon: Icon(Icons.delete),
),
);

Here u see how it looks with a row

没有行,只有图像,标题和副标题可见。

请帮忙。泰

最佳答案

使用CheckboxListTile

ListView(
children: List.generate(
30,
(item) => CheckboxListTile(
dense: true,
controlAffinity: ListTileControlAffinity.leading,
secondary: Icon(Icons.delete),
value: false,
onChanged: (g) {},
title: Row(
children: <Widget>[
FlutterLogo(),
Expanded(
child: Text("item"),
),
],
),
)),
)

关于dart - 如何创建带有 2 个 Widget 的 Listtile?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54061523/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com