The getter ‘documents’ isn’t defined for the type ‘QuerySnapshot’

The QuerySnapshot class has a docs property, which then return a List<QueryDocumentSnapshot>. You can then access an index from this List which gives you a QueryDocumentSnapshot that you can then acess its .data() method to have a Map<String, dynamic>. Finally you can access any field from that.

Try:

snapshot.data.docs[index].data()['imageUrl'],

Leave a Comment