Which one to use Stream or Future when you get data from the network? because we want to get any updates to the user data, see, we have an edit profile feature, after the user edits their profile, we want every screen that uses the user data for displays to update automatically, that’s why. Learn…
Category: Firebase
Flutter Web App Correct Way to Run from Mobile App
Here i will cover the steps, those are needed to convert a Flutter mobile to browser app. By this, I mean how to run a mobile app in the browser. In general pretty much the below command could do the tricks. The above command does the trick. But sometimes it is not that simple. For…
Firestore Database and permission
Here we will see about firestore database and it’s permission for read and write. From the above picture, you see there’s a Firestore Database on the left, if it’s not there, you need to select it from build menu of your console, see at the bottom of the picture on the left, you will see,…
Firebase Data & ListView
Here we will see how to load data from Firebase Firestore and show the data in a ListView. We will use ListView.builder to do. We will have a list name items and a temporary list tempList. items would be accessed from the UI. Once we load the data then we will assign data from tempList…
Flutter Firestore add data
Here, we will see how to add data to firestore collection. We have to do the below things First we get collection reference like below Then we add the add() to it. Inside this we need to map or json format data. Let’s take a look at our function that will add data to the…
Firestore set data
Make sure you have you firebase project set up. We will use firestore collection() and set() to set data to firestore collection. Since we need to use the set(), we need document ID. For document ID, we need to get all the documents. First we get all the documents using get() and then we access…
How do I get collection data in firebase?
It’s easy to get collection data in Firebase. Just use the get() function with your collection name. Let’s take a look at the code below Here we need to use FirebaseFirestore.instance to get a reference of the Firestore instance. Then we mention the collection name. With the collection name we use the get() function. get()…
FlutterFire Messaging: An error occurred in your background messaging handler
If you work with firebase messaging and wanna get background message, you may get this error. I got this error as I was working in my video chatting app. At first glance it may look like a Getx error, but it’s not. The entry point of this error is FirebaseMessaging.oBackgroundMessage is the function that takes…
Flutter ImagePicker() and File Upload to Firebase
Here I have note down some important information, that you might find useful when you work with ImagePicker() plugin and Firebase Storage for file uploading. What does imagePicker() return? It returns a XFile object How to get the image path from XFile object? You can get by xFileObjet.path Why do you need File() constructor? We…