A new Flutter project.
The application requires the Firebase to run. The debug build connects to the local emulator by default while the production build connects to the production Firebase.
-
Install the Firebase CLI https://firebase.google.com/docs/cli#setup_update_cli
-
Start emulator
firebase emulators:start
To disable the emulator in the dev environment, disable the line of codes in lib/main.dart
or build in production mode
if (kDebugMode) {
try {
FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
} catch (e) {
// ignore: avoid_print
print(e);
}
}
Reference: https://firebase.google.com/docs/flutter/setup?platform=web
-
Create a Firebase project from https://firebase.google.com/
-
Install Firebase CLI https://firebase.google.com/docs/cli#setup_update_cli
-
Login to firebase
firebase login
-
Install FlutterFire
dart pub global activate flutterfire_cli
-
Configure it using this command in the Project
flutterfire configure