如何创建包含图像和复选框的前导小部件?
我尝试使用 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),
),
);
没有行,只有图像,标题和副标题可见。
请帮忙。 泰
最佳答案
使用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/