Reputation: 178
hi guys i'm trying to get data from my firestore database into List<String>
for that i create variable List<String> listCour;
and i use that instruction for get data from firestore
Firestore.instance
.collection('MATH')
.document(doc.documentID)
.collection("cours")
.snapshots()
.listen(
(cour)=> cour.documents.forEach((doc){
listCour.add(doc.documentID);
})
);
but the List has get no data !!
Upvotes: 1
Views: 3339
Reputation: 1417
Try using doc.data
listCour.add(doc.data);
Firestore.instance
.collection('MATH')
.document(doc.documentID)
.collection("cours")
.getDocuments()
.then((QuerySnapshot snapshot) {
snapshot.documents...
})
Upvotes: 1