1

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 !!

1 Answer 1

1

Try using doc.data

listCour.add(doc.data);                   
Firestore.instance
    .collection('MATH')
    .document(doc.documentID)
    .collection("cours")
    .getDocuments()
    .then((QuerySnapshot snapshot) {
      snapshot.documents...
    })

Sign up to request clarification or add additional context in comments.

1 Comment

no data :( i try any affection inside ` forEach((doc){ ---- } ` and didn't working i don't know why

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.