# create a flutter app run this command
flutter create app_name --org com.YOUR_ORG_NAMEStep 2: Create a Firebase Console Account
Visit the Firebase Console and log in with your Google account. Optionally, create a new project with a unique name.
Step 3: Open Flutter Project in IDE
Open your Flutter project in your preferred IDE (e.g., VSCode).
Prerequisites
Make sure you have the following installed:
- Firebase CLI
- Flutterfire CLI
Already setup firebase and flutterfire cli then skips (1.0-2.0)
-
Install Firebase CLI
# To follow the next Step you must npm or yarn installs your system. (install npm) npm install -g firebase-toolsFor Linux:
curl -sL https://firebase.tools | bash -
Configure Firebase CLI
Log in to your account with Firebase CLI:
firebase loginIt will open a new tab in chrome select the account and give the permission. If you successfully log in then flow to the next step.
-
Install Flutterfire CLI:
dart pub global activate flutterfire_cli
Step 4: Initialize Firebase in Your App
Open your project in VSCode and navigate to the root directory. Run the following commands in the terminal:
-
From your Flutter project directory, run the following command to install the core plugin:
flutter pub add firebase_core -
Ensure your Flutter app's Firebase configuration is up-to-date
flutterfire configure -
In your
lib/main.dartfile, import the Firebase core plugin and the configuration file you generated earlier:import 'package:firebase_core/firebase_core.dart'; import 'firebase_options.dart'; -
Also in your
lib/main.dartfile, initialize Firebase using theDefaultFirebaseOptionsobject exported by the configuration file:await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); -
Rebuild your Flutter application:
flutter run
For more details, refer to the official Firebase CLI documentation and Flutter setup guide.

