This is the companion app of the Flutter Firebase Compendium with code examples.
The Flutter Firebase Compendium is a detailled introduction for Flutter developers to work with Firebase. It explains how to use Firebase services from a Flutter application. Check out my ebook with many details that will save you many hours of research time to develop your apps quicker. You can learn more about it here.
- Firebase project setup
- Firebase Authentication
- Firebase Cloud Firestore
- Firebase Cloud Functions
- Firebase Storage
- Firebase App Check
- Firebase Remote Config
- Firebase Hosting
- Firebase Crashlytics
The code uses Firebase as a backend but the Firebase configuration is not included. You have to add it yourself because there are paid features that might cause costs. Refer to this article above on how to perform the necessary steps in detail.
- Create a Firebase project
- Install Firebase CLI
- Install FlutterFire CLI
- Check out the code
- Execute
firebase login
from the app root folder and log into your created Firebase project - Execute
flutterfire configure
from the app root folder and use your created Firebase project - A file
firebase_options.dart
will be created in yourlib
folder - (Authentication only) Activate the sign-in providers Email/Password and Google
- (Cloud Functions only) Execute
firebase deploy --only functions
to deploy the demo functions. You might need to runnpm install
from inside the functions folder to make it work. You need to adapt the link infunctions_page.dart
according to your Firebase instance. - (Storage and Cloud Firestore only) Set security rules for Storage and Firestore
- (App Check only) Register an attestation provider and enforce App Check
- (Remote Config only) Create parameters with conditions for Remote Config
- Run the app
- 💡 Social sign-ins only works on web platform without additional configurations
- 💡 You need to replace the link on
functions_page.dart
according to your deployed function link! - 💡 Don't forget to set the security rules for Storage and Firestore!
- 💡 To get file downloads from Firebase Storage work on the web platform, you need to set specific CORS rules!
- 💡 SafetyNet deprecated, supported until June 2024!
- 💡 Play Integrity provider for Android only works for apps that are distributed via Google Play!
Overview of supported platforms of the used Firebase packages.
✔ - supported ❌ - not supported
Android | iOS | Web | MacOS | Windows | Linux | |
---|---|---|---|---|---|---|
Authentication | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
Firestore | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
Functions | ✔ | ✔ | ✔ | ✔ | ❌ | ❌ |
Storage | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
App Check | ✔ | ✔ | ✔ | ✔ | ❌ | ❌ |
Remote Config | ✔ | ✔ | ✔ | ✔ | ❌ | ❌ |
Crashlytics | ✔ | ✔ | ❌ | ✔ | ❌ | ❌ |
- Follow me on Medium
- Visit my QuickCoder blog
- Check out my digital products