How to Setup Connection Between Firebase Database and Flutter App

What is Firebase?

Firebase is a cloud-based development platform best known for its real-time database, which is still a multi-node, key-value database specialized for synchronizing data between user computers or smartphones and centralized cloud storage. It’s made to make developers’ lives easier by taking care of a lot of the data pushing and pulling. This frees app developers from the coding headaches that come with maintaining versions and locales. They can write the updated bits to Firebase, ensuring that the data is consistent throughout the system.

Getting Firebase URL of the Realtime Database

Follow the below steps to get it in the new UI of Firebase Console:

  1. Go to your project in Firebase Console.
  2. Tap Database below Authentication and select Realtime Database (marked 1 in the picture).
  3. Marked 2 is the Firebase URL.

Getting Firebase URL Of The Firestore Database

  1. Go to Cloud Firestore tab.
  2. Take the ID as circled in the image below.
  3. Then the Firebase URL need to be formatted like this
enter image description here

Connecting Firebase Database on your Project

  • Download the google-services.json file inside of your Firebase Project.
enter image description here
  • Copy the file you downloaded inside your Project. Go to android >> app then paste it.
  • Last is open the google-services.json file and add your Firebase URL that you get earlier on it. Save it and it will communicate on your Firebase Database.


Leave a Comment

Your email address will not be published. Required fields are marked *