How to Add Firebase into Flutter in a New Way?
Last Updated :
04 May, 2025
Recently Firebase give another option for adding Firebase to Flutter and It is only made for Flutter, As of now we add firebase using the android option for flutter but now we can add using the flutter option that is recently updated by Flutter. Here you can find how to add firebase as an Android in Flutter.
Step-by-Step Implementation
Step 1: Create a Firebase Project
First, you have to visit the Firebase console. Now let’s move to the next step. Click on the “Create a Firebase Project” as shown in the video below.
Step 2: Select Flutter Icon
Now, there will be a screen. Here, you can find the old Android version and the New Flutter option. Click on the Flutter icon button.
Step 3: Prepare your workspace
Now time to add Firebase to the Flutter app,
As shown in the above image, Before going to start you have to Install the Firebase CLI and Login in if you have not previously installed it. Now click on Next.
Step 4: Install and run the FlutterFire CLI
Now, run these two commands from your terminal:
dart pub global activate flutterfire_cli
While doing this, you must notify the following warning
Warning: Pub installs executables into C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path. You can fix that by adding that directory to your system's "Path" environment variable. A web search for "configure windows path" will show you how.
This means you need to add C:\Users\*username*\AppData\Local\Pub\Cache\bin into your System's environment path. Now, again, fire this command-
flutterfire configure --project=addflutter-72e0c
Surely again you will get an error,
bash: flutterfire: command not found
Flutterfire configure command should work now - close and open again command prompt or another terminal. Sometimes there is a problem with other editors and terminals where flutterfire configure still does not work. In that case, open Command Prompt and it works there for sure.
This command adds, the firebase_options.dart into your lib file. Now add the following code to your main file.
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
// ...
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
Congratulations you have successfully Installed the firebase in your flutter application. And now use firebase in your flutter application.
Similar Reads
How to Add Firebase to Flutter App? Firebase is a product of Google that helps developers to build, manage, and grow their apps easily. It helps developers to build their apps faster and more securely. No programming is required on the Firebase side which makes it easy to use its features more efficiently. It provides services to Andr
3 min read
Google Sign In With Firebase in Flutter Firebase is a product of Google that helps developers to build, manage, and grow their apps easily. It helps developers build their apps faster and more securely. No programming is required on the Firebase side which makes it easy to use its features more efficiently. Google Sign-in with Firebase in
6 min read
Flutter - Read and Write Data on Firebase Firebase helps developers to manage their mobile apps easily. It is a service provided by Google. Firebase has various functionalities available to help developers manage and grow their mobile apps. In this article, we will learn how to write and read data into/from Firebase. Follow the 3-step proce
4 min read
Flutter - Realtime Database in Firebase Firebase helps developers to build and run their apps successfully; its backend is developed by Google. Firebase is very easy to use for beginners; it provides many functionalities like Firebase Authentication, Cloud Firestore, Realtime Database, Firebase Storage, etc, which help to build and optimi
6 min read
How to Create Dynamic Intro Slider in Android using Firebase Firestore? We have seen creating a basic Intro Slider in Android which is used to inform our users regarding the features of our app and many more. In this article, we will take a look at the implementation of dynamic Intro Slider in our app with the help of Firebase. With the help of Firebase Firestore, we ca
11 min read