繁体   English   中英

如何创建带有2个小部件的Listtile?

[英]How to Create Listtile leading with 2 Widgets?

如何创建一个包含图像和复选框的领先的小部件?

我尝试使用“行小部件”,但是我的列表对象长大了。

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"),
                      ),
                    ],
                  ),
                )),
      )

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM