Mobile App Development — Level 3: Firebase, Architecture & Testing
Get Started Free
Free preview
Setting up Firebase with FlutterFire
Lecture notes
Firebase is Google's Backend-as-a-Service: authentication, databases, file storage, push notifications, analytics, crash reporting and hosting — without managing servers. The free Spark plan covers learning and small apps; Blaze is pay-as-you-go.
Setup steps
- Create a project at
console.firebase.google.com. - Install the Firebase CLI (
npm install -g firebase-tools) and log in:firebase login. - Install the FlutterFire CLI:
dart pub global activate flutterfire_cli. - In your project:
flutterfire configure— select the Firebase project and platforms; it registers the apps and generateslib/firebase_options.dart. - Add the core package:
flutter pub add firebase_core.
Initialise before runApp
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
runApp(const MyApp());
}
Firebase products you will use
firebase_auth— sign-in.cloud_firestore— NoSQL document database with real-time updates and offline cache.firebase_storage— files and images.firebase_messaging— push notifications (FCM).firebase_crashlytics,firebase_analytics— quality and usage (Level 4).
The values in firebase_options.dart identify your project; they are not secret, but your data must be protected with Security Rules and App Check.
Want to go further?
20 h · Enroll to access every lesson and earn the certificate.