I tries this code but it shows me this error :Bad state: field does not exist within the 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
help please