I tried with different ways but i can't edit the structure of code
//First way QuerySnapshot querySnapshot = await db.firestoreInstance.collection('user-history').get(); var list = querySnapshot.docs; print('MY LIST ===== $list'); //Second way final CollectionReference collectionRef = db.firestoreInstance .collection(historyCollection); print('MY SECOND LIST ===== $list'); collectionRef.get().then((qs) { qs.docs.forEach((element) { print('MY doc id ${element.id}'); }); }); In my firebase collection(historyCollection) i have four documents but the debugger returns me empty array []. Is there another way to call all documents in certain collection through flutter? I'm trying to call this method through FutureBuilder component.
My version of firestore is: "cloud_firestore: ^0.16.0+1"
I/flutter ( 7767): MY LIST ===== [] I/flutter ( 7767): MY LIST LENGTH ===== 0 I/flutter ( 7767): MY SECOND LIST ===== [] I/flutter ( 7767): MY SECOND LIST LENGTH ===== 0