【发布时间】:2020-05-26 18:30:57
【问题描述】:
我是新来的颤振。 请帮我解决卡片列表视图。 我正在从 SQLite 获取数据并将其直接设置为 listview。请让我知道如何在我的代码中添加卡。 这是我的代码。
body: FutureBuilder<List<UserModel>>(
future: db.getUserModelData(),
builder: (context, snapshot) {
if (!snapshot.hasData)
return Center(child: CircularProgressIndicator());
return ListView(
children: snapshot.data
.map((user) => ListTile(
title: Text(user.name),
subtitle: Text(user.bDate),
leading: CircleAvatar(
backgroundColor: Color(
(math.Random().nextDouble() * 0xFFFFFF)
.toInt() <<
0)
.withOpacity(1.0),
child: Text(user.name[0],
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
)),
),
))
.toList(),
);
},
),
【问题讨论】:
-
你能解释一下你需要什么吗?
-
@SelimKundakçıoğlu 我想将卡片添加到我的此列表中