skip to Main Content

Firebase – How to loop through Instance of '_MapStream<QuerySnapshotPlatform, QuerySnapshot<Map<String, dynamic>>>'?

static List categoryList() { final categorySnapshots = FirebaseFirestore.instance .collection('categories') .orderBy('name') .snapshots(); List categories = []; categorySnapshots.map((snapshot) => snapshot.docs.map((doc) { print(snapshot.toString()); categories.add(doc.data()['name']); })); print(categories); return categories; } Categories is empty. How to populate it with the data from snapshots?

VIEW QUESTION

@firebase/firestore: Firestore (8.2.2): Connection WebChannel transport errored (HOW TO FIX THIS?) I cant find any solutions its been 1 week already

my Code for firestore my Code for firestore SET I have tried: firebase.firestore().settings({ experimentalForceLongPolling: true,merge:true }); firebase.firestore().settings({ experimentalForceLongPolling: true }); firebase.firestore().settings({ experimentalAutoDetectLongPolling:true}); Nothing works ... still getting the error. This is the ERROR: WARN [2022-07-07T23:56:51.946Z] @firebase/firestore: Firestore (8.2.2): Connection WebChannel…

VIEW QUESTION
Back To Top
Search