Firebase integration into Flutter refers to the use of Firebase services in Flutter application development. Firebase provides a variety of backend services that can be easily integrated into Flutter apps for managing data, user authentication, cloud messaging, and more. Following are the general steps to integrate Firebase into a Flutter application.
1. Firebase integration w/ Flutter
Muhammad Zhafran
linkedin.com/in/zfrn
@zhafran_dev
Get to know more about the Firebase in Flutter
Development
2. OUTLINE
Folks, here are what we’re going to talk about…
Wut is firebase?
Advantage
What does it
have to do w/
Flutter?
Lil bit of Google
Cloud
Computing
The
functionality
Q&A
The Features
Quiz
3. Get to Know Firebase
What is Firebase?
● Firebase is an app development platform that helps you build and
grow apps and games users love. Backed by Google and trusted by
millions of businesses around the world.
5. The paid stuff
● Firebase Realtime Database
● Firebase Authentication
● Firebase Cloud Functions
● Firebase Hosting
● Firebase Cloud Storage
● Firebase Cloud Firestore
● Firebase ML (Machine Learning) Services
Firebase is free or nah?
6. Let’s know these 2
● Flutter is an open-source UI software development kit
● Firebase is a set of backend cloud computing services and application
development platforms provided by Google.
● Flutter and Firebase can be a powerful combination for developing
modern and feature-rich mobile applications.
Flutter with firebase
7. Best practice
● Mobile Applications
● Startups and Prototyping:
● Real-time Collaboration Apps
● Progressive Web Apps (PWAs)
● Small to Medium-sized Projects
● Authentication and User Management
● IoT (Internet of Things) Applications
● Serverless Architecture
When to use Firebase?
8. When we should not use?
Not suitable w/ Firebase?
● Complex Backend Logic
● Large-Scale Enterprise Applications
● Data Intensive Applications
● Need for Full Control Over Infrastructure
● Offline-First Applications
● Budget Constraints for High Usage
● Non-Google Ecosystem
● Advanced Machine Learning or AI
12. Firebase Features
● Google Analytics is a free app measurement solution that provides
insight on app usage and user engagement. Analytics reports help you
understand clearly how your users behave, which enables you to make
informed decisions regarding app marketing and performance
optimizations.
Google Analytic
13. Firebase Features
● App Check helps protect your backend resources (such as Cloud
Storage) from abuse (such as billing fraud or phishing).
● With App Check, devices running your app will use an app identity
attestation provider to certify it is indeed your authentic app, and may
also check that it's running on an authentic, untampered device. This
certification is attached to every request your app makes to your
Firebase backend resources.
App Check
14. Firebase Features
● Firebase Authentication provides backend services & easy-to-use SDKs
to authenticate users to your app. It supports authentication using
passwords, phone numbers, popular federated identity providers like
Google, Facebook and Twitter, and more.
Authentication
15. Firebase Features
● Firestore is a flexible, scalable NoSQL cloud database to store and sync
data. It keeps your data in sync across client apps through realtime
listeners and offers offline support so you can build responsive apps
that work regardless of network latency or Internet connectivity.
Firestore
16. Firebase Features
● The Cloud Firestore ODM package enables developers to build fully
type-safe applications for Flutter using the FlutterFire Cloud Firestore
plugin.
● The ODM allows data schemas to be defined which represent the data
structure of your Cloud Firestore database. By defining schemas the
ODM provides the following benefits:
↔️ Bi-directional data validation.
🔒 Type-safe data querying, supporting all Firestore query operations.
🔄 Flutter Widgets for simple data binding with your data.
🎯 Data selectors to help avoid unnecessary Widget rebuilds.
💻 Full API code completion.
Cloud Firestore ODM
17. Firebase Features
● Cloud Functions for Firebase let you automatically run backend code in
response to events triggered by Firebase features and HTTPS requests.
Your code is stored in Google's cloud and runs in a managed
environment. There's no need to manage and scale your own servers.
Cloud Functions
18. Firebase Features
a cross-platform messaging solution that lets you reliably send
messages at no cost.
Using FCM, you can notify a client app that new email or other data is
available to sync. You can send notification messages to drive user re-
engagement and retention. For use cases such as instant messaging, a
message can transfer a payload of up to 4 KB to a client app.
Firebase Cloud
Messaging
19. Firebase Features
● Crashlytics helps you to collect analytics and details about crashes and
errors that occur in your app. It does this through three aspects:
● Logs: Log events in your app to be sent with the crash report for context if your app
crashes.
● Crash reports: Every crash is automatically turned into a crash report and sent when
the application next opens.
● Stack traces: Even when an error is caught and your app recovers, the Dart stack
trace can still be sent.
Cloud Storage
20. Firebase Features
● Links that work the way you want, on multiple platforms, and whether
or not your app is already installed. If a user opens a Dynamic Link on
iOS or Android, they can be taken directly to the linked content in your
native app. If a user doesn't have your app installed, the user can be
prompted to install it; then, after installation, your app starts and can
access the link.
Dynamic Links
21. Firebase Features
● The Firebase Realtime Database is a cloud-hosted database. Data is
stored as JSON and synchronized in realtime to every connected client.
When you build cross-platform apps Flutter & Firebase, all of your
clients can share one Realtime Database instance and automatically
receive updates with the newest data.
Realtime Database
22. Firebase Features
● Firebase In-App Messaging helps you engage your app's active users by
sending them targeted, contextual messages that encourage them to
use key app features. For example, you could send an in-app message
to get users to subscribe, watch a video, complete a level, or buy an
item. You can customize messages as cards, banners, modals, or
images, and set up triggers so that they appear exactly when they'd
benefit your users most. Use Firebase In-App Messaging to encourage
exploration and discovery: highlight a sale or coupon in your
ecommerce app, give clues or tips in your game, or prompt a like or
share in your social media app.
In-App Messaging
23. Firebase Features
● If you use custom TensorFlow Lite models, Firebase ML can help you
ensure your users are always using the best-available version of your
custom model. When you deploy your model with Firebase, Firebase
ML only downloads the model when it's needed and automatically
updates your users with the latest version.
● Once downloaded, you can use packages such as tflite_flutter to
interpret your model.
Realtime Database
24. Firebase Features
● The Firebase Realtime Database is a cloud-hosted database. Data is
stored as JSON and synchronized in realtime to every connected client.
When you build cross-platform apps Flutter & Firebase, all of your
clients can share one Realtime Database instance and automatically
receive updates with the newest data.
Realtime Database
29. Quiz Time
What is Firebase?
a) A cloud computing platform
b) A mobile and web application development platform
c) A social media platform
d) A hardware manufacturing company
Question 1
30. Quiz Time
Which database does Firebase primarily use for real-time data
synchronization?
a) MongoDB
b) SQLite
c) Firebase Realtime Database
d) MySQL
Question 2
31. Quiz Time
What authentication providers does Firebase support?
a) Google, Facebook, and Twitter
b) Amazon, Microsoft, and LinkedIn
c) Instagram, Snapchat, and TikTok
d) Yahoo, AOL, and Outlook
Question 3
32. Quiz Time
What is Firebase Cloud Functions used for?
a) Managing cloud storage
b) Running server-side code in response to events
c) Creating user interfaces
d) Analyzing data in real-time
Question 4
33. Quiz Time
In Firebase, what is Firestore?
a) A cloud storage service
b) A real-time database
c) A serverless computing platform
d) An authentication provider
Question 5
35. Quiz Time
In Flutter, what widget is commonly used to initialize Firebase
services?
a) FirebaseAppWidget
b) FirebaseInitialize
c) FirestoreWidget
d) Firebase.initializeApp()
Question 6
36. Quiz Time
In Flutter, what is the purpose of the firebase_core package?
a) Firebase authentication
b) Firebase real-time database
c) Firebase Cloud Messaging
d) Firebase core initialization
Question 7
37. Quiz Time
What type of database is Firestore?
a) Relational database
b) NoSQL database
c) Graph database
d) In-memory database
Question 8
38. Quiz Time
In Firestore, what is a Document?
a) A table
b) A record
c) A collection of data
d) A JSON-like object with key-value pairs
Question 9
39. Quiz Time
How are documents organized in Firestore?
a) In tables
b) In rows and columns
c) In collections
d) In folders
Question 10