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

Cannot proceed google login with firebase on flutter; "Expecting binder but got null!"

I am new to mobile app and using flutter to implement google social login with firebase auth. I checked official resources and implemented a login logic like below; main.dart import 'package:atlas_app/auth/signup.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; import 'firebase_options.dart'; void…

VIEW QUESTION
Back To Top
Search