【发布时间】:2021-05-16 21:47:30
【问题描述】:
我尝试了这段代码,但它显示了这个错误:错误状态:DocumentSnapshotPlatform 中不存在字段
body: Center(
child: Container(
padding: const EdgeInsets.all(20.0),
child: StreamBuilder<QuerySnapshot>(
stream: FirebaseFirestore.instance
.collection("users")
.doc(widget.uid)
.collection('tasks')
.snapshots(),
builder: (BuildContext context,
AsyncSnapshot<QuerySnapshot> snapshot) {
if (snapshot.hasError)
return new Text('Error: ${snapshot.error}');
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return new Text('Loading...');
default:
return new ListView(
children: snapshot.data.**docs**
.map<Widget>((DocumentSnapshot document) {
return new CustomCard(
title: document.data()['title'],
description: document.data()['description'],
);
}).toList(),
);
}
},
)),
),strong text
请帮忙
【问题讨论】:
-
不明白确切的错误
标签: firebase flutter mobile google-cloud-firestore firebase-authentication