Issue I am calling data from firestore like this: getDoctorData() async { DocumentSnapshot<Map<String, dynamic>> _snapshot = await FirebaseFirestore.instance.collection(‘doctors/1/1’).doc(‘1′).get(); return _snapshot.data()!; } I call the function as follows: final _query = getDoctorData(); Since it’s a Future, I decided to convert it
Continue readingTag: google-cloud-firestore
Flutter Fire Type cast AsyncSnapshot<QuerySnapShot<Map<String, dynamic>>> to List<dynamic>?
Issue Cloud Firestore Database and Flutter. My Implementation AsyncSnapshot<QuerySnapshot<Map<String, dynamic>>> snapshot After snapshot has data if (snapshot.hasData) { final List<dynamic> _products = snapshot.data!docs[0].data() as List<dynamic> } Value of the expression snapshot.data.docs[0].data() using debugging I found it not null. It is
Continue readingFirebase instances instead of references
Issue In the Firebase documentation, it declares final references to Auth or Firestore like this: CollectionReference users = FirebaseFirestore.instance.collection(‘items’); My problem is that I have to modify the instance settings on the fly to inject whereBy parameters, specific docs or
Continue readingFetching user name returns null at first time with Flutter Firebase
Issue I want to have the username (in Arabic) on the home page from firebase. When I ran the app the first time every time I turn on the emulator it returns null. But if I run it one more
Continue readingAbout writing data more than 500 in firebase with flutter
Issue i have problem when i try to make write with batch.set into firebase database .. when i use small data to set it! its created correctly and so fast but when i write alot of data like 200 questions
Continue readingCloud Firestore error The operator '[]' isn't defined for the type 'Object'. after Upgrade to 2.0.0?
Issue This is NOT the old doc.data[‘field’] vs. doc.data()[‘field’] migration issue…it’s new (to me): The following code is a common example in my project running fine for the last 8 mos in Flutter with Firebase. I’m migrating to null safety,
Continue readingUnable to save the data in model from firestore after migrating to null safety
Issue So, I have a user model where i want to store the value from the document present in firestore and for that i have the following code:- import ‘package:cloud_firestore/cloud_firestore.dart’; class UserModel { final String? id; final String? username; final
Continue readinghow can i retrieve document id of each document from Firestore in flutter
Issue Here i have the code where i retrieve all the documents from Firebase, i am only able to retrieve the data present inside the document but i also want to retrieve the document Id with it, how can i
Continue readingHow to type cast for my use case in Dart 2
Issue I am trying to clean-up some (working) code on a fork of the Flutter Architecture Samples github project. Does anyone familiar with casting in Dart 2 have any suggestions on how to clean up my attempt? This may change
Continue readingHow to create a user profile based on uid and navigate to the profile page?
Issue I created a user with firebase authentication, also it has its own database. The user can send friend requests to other users, the senders uid is saved in the receiver user’s request collection. In my app I can list
Continue reading