Hello everyone!
If you want to integrate Firebase with your Flutter app efficiently then you are at the right place. This step-by-step guide will walk you through setting up Firebase CLI in Android Studio from project creation to command-line installation and authentication. By the end you will have Firebase fully integrated into your Flutter app. It will be ready to use powerful services like Firestore, Authentication, and Cloud Functions provided by the firebase.

Let us start:

First of all go to the firebase console to create and add a new project which you want to integrate with the flutter and firebase.
Then simply click on the create new project for the creation of the firebase project to handle it with the flutter development.
Then we need to add the name of the project. The name should be unique and it should not similar to any other project in the firebase.
Here you can enable the google analytics if we allow it, it will monitor the application. These analytics help in the issue submission, cloud messaging, In-app messaging, remote configuration, A/B testing and cloud functions.

Now here if you are using Google Analytics you have to accept the terms and conditions of the Google analytics. While accepting the terms and conditions you have to choose the location of the analytics. It is not the location for which the analysis will be collected but it is the region which will be used to store the collected data. You can select any suitable region for your app.

After accepting all these terms and conditions and setting up the previous things and while clicking on the submission button it will take some time in the processing. And after the completion of the process the project will be created.

Here you can see the project has been created with my given name. The name should be unique.
Here we have to select our preferred operating system for the application to run in this created project. As currently I am going to develop an android application so I have selected Android you can select any of these options. Follow the steps and your project will be added to your android application.
Now in order to use in in the system we need to run the command in the terminal as shown to install the firebase tools in the editor to use it through the Firebase CLI which is the easiest way to integrate it.
After the completion of the installation we see a message like this. It is saying 634 packages were added in the editor and it took around 2 minutes of time.

Now in order to confirm the instaltion of firebase_tools
run this command firebase --version
. If it returns the version of the firebase then it is sure it has installed correctly.

Now to login your firebase run this command firebase login
. It will require some permissions from the system and you have to allow these permissions. The permission pp up is showing above.

After running the login command it will open the browser which will require your accounts authentication to login it and use it in the android studio or in any other code editor on which you are working.
Select your account in which you already made the firebase account and the project.

Now accept the terms and conditions and allow the permissions to firebase. These permissions include edit, configure, delete and more.

After this you will see a pop up message like this that login is successful. In this way we can login using the firebase command line tool.

Now we need to choose the functions and features for our project to add in the application. In order to choose the sevices for our application we need to run the command firebase init
. This will initialize the firebase in the terminal. You can see in the above picture all the services and we can choose which suits our project the best.
https://x.com/stylishtiger3/status/1890325898269716920
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit