Im trying to retrieve data from firestore and putting them into a list so that i can build read and build widgets from the data retrieved. I cant seem do both, i can either get the data, or append a list with a fixed value, but i CANT seem to RETRIEVE DATA + APPEND THE LIST WITH THE RETRIEVED DATA
. Sorry if im not being clear enough, do let me know what do you need, below is my screenshot from my database structure and code snippets.
Data retrieval code snippet :
onRefreshPage() {
Firestore.instance
.collection("testimonies")
.getDocuments()
.then((querySnapshot) {
querySnapshot.documents.forEach((result) {
print(result.data);
});
});
}
List declaration :
List<DocumentSnapshot> testimonyCards = [];