【发布时间】:2019-10-29 09:01:33
【问题描述】:
我想为我的应用创建一个群组功能,到目前为止,当我设置每个用户的个人资料页面时,我已经使用了这样的东西:
DocumentReference documentReference =
_firestore.collection("users").document("$email");
await documentReference.get().then((DocumentSnapshot datasnapshot) {
if (datasnapshot.exists) {
displayName=datasnapshot.data['displayName'].toString();
bio=datasnapshot.data['bio'].toString();
print(bio);
}
else {
print("No such user");
}
这可行,但我想如果我想创建组并记录不同用户可能做出的更改,那么我可能应该使用流,对吗?一般来说,如果有人可以提供一些见解,我不确定何时使用哪个?
【问题讨论】:
标签: flutter dart stream google-cloud-firestore