How do I make a subcollection of user data in Firebase?

I'm creating an Hospital App in flutter. My goal is to configure firebase in such a way that the root collection is named User/uid(uid which is automatically generated...

QuerySnapshot docs.length just return 0

I was trying to make a clone of instagram, and I got to the part that I want to display the number of comments of the post using QuerySnapshot. My code is as follow:</...

Issue adding element to list

I'm a total newbie to Flutter and I'm trying to add some data from Cloud Firestore to a list in Flutter, but having issues. I try to add the element, but after executi...

Flutter: Firestore component is not present

I have a problem with Firestore database under Flutter. I have done everything, what the package setup documentation says, looked into 2-3 finished public application,...

Firestore transaction fails with Transaction failed all retries

I'm running a very simple Firestore transaction which checks for the presence of a document, before writing to it if absent. (The use case is registering a use...

Flutter Firestore - PERMISSION_DENIED: Missing or insufficient permissions

I have the following simple rules set up in my firestore database. <pre><code>service cloud.firestore { match /databases/{database}/documents { function isS...

How to convert DocumentSnapshot to Map&lt;String, dynamic&gt;?

<strong>I have a <code>DocumentSnapshot</code> parameter, and I want to convert it to <code>Map</code></strong>. How do I achieve that? Note: In my case...

Get information from Firebase and able to use it with a Gridtile and GestureDetector in Flutter

So I'm trying to design a Widget which can basically create a view where you can have something like this: <a href="https://i.stack.imgur.com/GHtKE.png" rel="no...

How do I get my document fields into a model field from Firestore

I have a list of documents from Firestore (postItemz). I wish to pass these into a model (Post) built to hold the data <pre><code>class PostViewModel { List&lt;...

How to use constructor objects in another state using flutter

I am creating this shopping app , the home page displays pictures and some data from firestore firebase as a gridView. <a href="https://i.stack.imgur.com/hJfyN.jpg" re...

How to save a field as null to Firebase if no value is entered in TextFormField

'?? null' works if only the first field has it, however it won't save if the other field(s) also has '?? null'. Is there a better way to write this? <pre><code>onP...

Firestore: remove document and collections and same time

I have a portfolio collection in Firestore. Each portfolio has rents and I can remove any of this. Removing the rent just removes that, the rent itself but when I remo...

Firestore Array Size in Flutter

What is the possible way to get the number of elements in the firestore in flutter ? i tried <code>.length</code> but it did not work. i am using StreamB...

FirebaseException ([cloud_firestore/unavailable] The service is currently unavailable , and how to solve it

i created a simple app using flutter and firebase it all work well but when i click on profile icon from the navigationbar the app froze <strong>Profile page co...

How to listen correctly a stream on Flutter/bloc/Firebase?

I have a list on my firebase collection, I want to listen those elements and set a list of objects with data, so in my <code>ChatRepository</code> I'm returning the st...