
Before you link your Flutter app to Firebase, you need to make sure your tools are installed and you’re logged in. Follow these steps.
1. Check Your Setup
Run these commands to make sure everything is ready:
What to Check | Command | What It Does | What You Should See |
Firebase CLI | firebase –version | Checks if Firebase CLI is installed. | A version number like 12.x.x |
FlutterFire CLI | flutterfire –version | Checks if FlutterFire CLI is installed. | A version number like 0.2.x |
Login Status | firebase login –no-browser | Shows if you’re logged into Firebase. | Your email or a login prompt |
Projects List | firebase projects:list | Shows all your Firebase projects. | A list of your projects |
2. Install or Fix Tools (If Needed)
If any check above fails, run these commands:
Command | What It Does |
npm install -g firebase-tools | Installs or updates Firebase CLI |
dart pub global activate flutterfire_cli | Installs or updates FlutterFire CLI |
firebase login | Logs you into Firebase (opens a browser) |
3. Link Your Flutter App to Firebase
Go to the root folder of your Flutter project and run:
flutterfire configure |
This will guide you step by step to connect your app to Firebase and create configuration files like:
- firebase_options.dart
- google-services.json
Optional: Automatic Setup
If you want to skip the interactive questions (good for CI/CD), run:
flutterfire configure –project=YOUR_PROJECT_ID –platforms=android,ios,web –yes |
This sets up your app automatically for the specified platforms.