【发布时间】:2020-01-10 14:02:32
【问题描述】:
我想获取一些用户的文档(在我的收藏中:用户)。 我将所有我想要的 ID 存储在一个列表中。
List shortIDList = [12345, 23425, 32453]
我正在尝试使用此功能从 shortIDList 中获取用户。
shortIDList.forEach((element) => getFirestoreUsers(st: element));
getFirestoreUsers({String st}) async {
await Firestore.instance
.collection('users')
.document('$st')
.get()
.then((DocumentSnapshot ds) {
print(ds.data);
// I would like to add all these documents to a futurebuilder
});
}
我想添加可以在 futurebuilder 中使用的所有文档(到新列表?),以显示所有用户信息,例如:头像、姓名等...
这可能吗?
谢谢!
【问题讨论】:
标签: firebase flutter dart google-cloud-firestore