【发布时间】:2021-06-24 06:23:08
【问题描述】:
我正在尝试从用户文档中获取 FCMToken
并且能够立即将其用作 streambuilder
FirebaseFirestore.instance.collection("usersToken")
.doc(snapshot.data.docs[index].data()['userId'].toString())
.get();
//I don't know what to do from here on to be able to get it as a string
我该怎么做?
【问题讨论】:
-
我不确定您所说的“请问我该怎么做,而且您知道流构建器不能使用 await async”是什么意思。但由于您使用的是
get(),因此您需要使用FutureBuilder而不是StreamBuilder。
标签: firebase flutter dart google-cloud-firestore