我正在尝试从 firebase 获取特定 uid 文档的列表,这是代码
StreamBuilder(
stream: firestore
.collection('interest')
.doc('${auth.currentUser.uid}')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(),
);
}
return ListView.builder(
itemCount: snapshot.data.docs.length,
itemBuilder: (context, index) {
return Container();
});
}),
错误:
Class '_JsonDocumentSnapshot' has no instance getter 'docs'.
Receiver: Instance of '_JsonDocumentSnapshot'
Tried calling: docs
我的收藏
我正在尝试从该文档 uid 中获取列表 谢谢