Flutter & Firebase Masterclass

Learn about Firebase Auth, Cloud Firestore, Cloud Functions, Stripe payments, and much more by building a full-stack eCommerce app with Flutter & Firebase.

--

Completed

--

Lessons completed

to track your course
progress

Introduction

Firebase Pros and Cons

An overview of the Firebase Pros and Cons for Flutter app development, including: supported features and platforms, pricing, portability, vendor lock-in, and developer experience.

01 - Welcome
2:46
02 - Firebase Pros and Cons
10:22

Module 1

Firebase Basics

In this module we'll create a simple full-stack app with Flutter and Firebase. As part of this, we'll install the CLI tools, setup a simple authentication flow with the Firebase UI packages, and learn about Cloud Firestore features such as realtime listeners, CRUD operations, security rules, queries, caching, and offline mode.

01 - Firebase Basics: Introduction
2:10
02 - Starter project overview
4:31
03 - Creating the Firebase project and installing the CLI tools
4:22
04 - Configuring the Flutter app with the Flutterfire CLI
5:09
05 - Introduction to Firebase Auth & Firebase UI Auth
8:38
06 - Completing the email & password sign in flow
5:48
07 - Showing the correct page when the app starts with GoRouter.redirect
4:17
08 - Using authStateChanges() and the refreshListenable argument
3:43
09 - Refactor: replacing singletons with Riverpod providers
3:45
10 - Other Firebase Authentication Features: Overview
1:36
11 - Introduction to Cloud Firestore
5:52
12 - Installing Cloud Firestore and running on iOS and Android
3:05
13 - Overview of the jobs page and planned CRUD operations
2:09
14 - Adding one more route to GoRouter and updating the redirect logic
3:33
15 - How to add a document with the FirebaseFirestore API
6:27
16 - Using the FirebaseRepository to add jobs from the UI
4:38
17 - Showing list items with the FirestoreListView widget
6:07
18 - Using type-safe model classes
5:47
19 - Adding update and delete operations
7:00
20 - Filtering collections with `where`
3:06
21 - Intro to Firestore security rules
10:02
22 - Working with timestamps and sorting data
5:30
23 - Offline mode
3:03
24 - Pagination and the FirestoreQueryBuilder widget
2:31
25 - Wrap Up
2:56
26 - Request for Feedback (optional)

Module 2

Full-Stack eCommerce app overview

This module offers an overview of the starter project for the eCommerce app, including: app bootstrap code, project structure and feature-first app architecture, utility and helper classes, and how to use repositories as Firebase API wrappers.

01 - Section Intro
3:09
02 - VSCode Shortcuts, Extensions & Settings for Flutter Development
1:52
03 - Course Project on GitHub
1:56
04 - Cloning the starter project & pubspec.yaml file overview
5:04
05 - eCommerce app overview
4:29
06 - Project overview: app initialization and routing
3:15
07 - Project overview: helper classes and widgets
4:43
08 - Project structure: features and layers
6:48
09 - Unidirectional data flow from the data layer to the presentation layer
4:57
10 - How to add Firebase repositories to the data layer
6:49
11 - Updated Starter project
4:41
12 - Request for Feedback (optional)

Module 3

Firebase Authentication

In this module, we add Firebase Authentication to the eCommerce app by following the feature-first app architecture. As part of this, we implement an AuthRepository as a wrapper for FirebaseAuth, and connect it to the rest of the app.

01 - Section Intro
3:41
02 - Adding Firebase to the eCommerce app
10:08
03 - Creating an AuthRepository using the FirebaseAuth APIs
6:08
04 - The authStateChanges() method and the User class
7:15
05 - Testing the authentication flows with Firebase
3:07
06 - Dealing with Firebase auth exceptions
6:37
07 - Adding the email verification logic
9:05
08 - Automated testing with FirebaseAuth and wrap up
3:09
09 - Request for Feedback (optional)

Module 4

Cloud Firestore and Firebase Storage

In this module we implement a multi-page image upload flow with Firebase. Included: uploading images to Firebase Storage and storing the download URL with Cloud Firestore; adding, editing, and deleting products; user input and validation with complex forms; CORS setup for Firebase Storage images on Flutter web.

01 - Section Intro
3:18
02 - Cloud Firestore and Firebase Storage setup
4:33
03 - Updated starter project
10:08
04 - Image uploads: plan of attack
3:54
05 - Creating an ImageUploadRepository
4:45
06 - Creating an AsyncNotifier to upload images
7:11
07 - Creating new products as Cloud Firestore documents
4:22
08 - Completing the image upload logic
5:59
09 - Adding an ImageUploadService class
2:54
10 - Adding a watchProduct method to the ProductsRepository
6:11
11 - Cloud Firestore: realtime listeners vs one-time-reads
9:04
12 - How to edit existing products: overview
4:32
13 - Implementing the AdminProductEditController
10:43
14 - Deleting products
9:48
15 - Combining streams inside a provider with Rx.combineLatest
3:12
16 - Image uploads: final tweaks and completed code
4:38
17 - Basic security rules for the image upload flows
3:51
18 - Flutter web: adding a CORS policy to a Firebase storage bucket
5:18
19 - Wrap up & exercises
2:03
20 - Request for Feedback (optional)

Module 5

Firebase Local Emulator and Cloud Functions

In this module we get started with the Firebase Local Emulator and use it to write and test Cloud Functions locally. Also included: importing and exporting data, TypeScript basics, Cloud function triggers and HTTP callable functions, deploying and monitoring Cloud Functions.

01 - Section Intro
2:26
02 - Initializing the Firebase Local Emulator Suite with firebase init
7:35
03 - How to use the Firebase Emulators
6:23
04 - Exporting and Importing data with the Firebase Emulator
5:21
05 - Introduction to Cloud Functions and Project Setup with TypeScript
4:12
06 - TypeScript modules basics + Running our first Cloud Function using npm
6:00
07 - Writing a Cloud Function Trigger
9:51
08 - Fixing the infinite loop in the Cloud Function
4:43
09 - Introduction to HTTP callable functions
2:49
10 - Writing an HTTP callable function to delete all documents inside a collection
8:39
11 - Invoking an HTTP callable function from the Flutter client
7:33
12 - Deploying Cloud Functions with the Firebase CLI
4:45
13 - Setting a project budget in Google Cloud as a safety net
3:26
14 - Testing the deployed functions and inspecting the Google Cloud logs
3:52
15 - Wrap Up
1:24
16 - Request for Feedback (optional)

Module 6

Role-Based Authorization with Custom Claims

This module is about role-based authorization with Firebase. As part of this, we learn what custom claims are and how to set them inside a Firebase auth trigger, how to enforce security rules based on the Firebase ID token, how to combine custom claims and realtime listeners, and much more.

01 - Section Intro
2:09
02 - Introduction to Custom Claims
6:58
03 - Starter project and Firebase configuration
4:34
04 - Running the Flutter eCommerce app with the Firebase Local Emulator
3:43
05 - Writing a Firebase auth trigger to set the custom claims on the server
9:29
06 - Updating the Security Rules to enable Role-Based Authorization via Custom Claims
6:03
07 - How to show the admin UI only if the user is an admin
9:41
08 - How to force-refresh the ID token with a Cloud Firestore Listener
11:58
09 - Updating the GoRouter redirect code to account for the admin state
3:13
10 - Deploying and testing the Cloud Function Trigger
6:54
11 - Wrap Up
1:56
12 - Request for Feedback (optional)

Module 7

Diving Deeper with Cloud Firestore

This module dives deeper into Cloud Firestore, including topics such as NoSQL data modeling, complex realtime data flows, how to combine values from different Firestore documents using providers, and how to estimate and optimize the cost of your Firebase bill.

01 - Section Intro
2:24
02 - Updated Starter Project with Firebase seed data
3:33
03 - Implementing a Shopping Cart with Firebase: Overview
3:41
04 - Cloud Firestore Data Modeling for the Shopping Cart Items
6:43
05 - Implementing the RemoteCartRepository with Cloud Firestore
8:03
06 - Testing the Shopping Cart feature with Cloud Firestore
4:41
07 - Optimizing the Cart Total Calculation with Multiple StreamProviders
9:07
08 - How to estimate the cost of your Firebase app and minimize your Firebase bill
9:22
09 - Wrap Up
1:06
10 - Request for Feedback (optional)

Module 8

Checkout Flows with Stripe

This module shows how to build a seamless checkout experience using Stripe. On the client-side, we'll implement separate checkout flows on mobile and web with the Flutter Stripe SDK. On the server-side, we'll use the Stripe extension for Firebase, along with some custom Cloud Functions for order fulfillment, and more.

01 - Section Intro
5:39
02 - How to collect payments on mobile: Stripe or IAP?
2:23
03 - Introduction to Stripe
2:38
04 - Overview of the Flutter Stripe package and example app
3:54
05 - Payment flows with Stripe: conceptual overview
3:46
06 - Updated starter project & Flutter Stripe SDK setup
5:11
07 - Installing the Stripe Extension for Firebase
4:33
08 - Configuring the webhook for the Stripe Extension
4:37
09 - Creating products in the Stripe dashboard
7:35
10 - Adding new Cloud Function triggers to synchronize the Stripe data with Firestore
8:52
11 - Deploying and testing the new Cloud Functions
6:18
12 - Explaining the relationship between Stripe Customers and Firebase Users
3:34
13 - Demo: making payments on the client (mobile and web)
5:52
14 - Overview of the client payment flows on mobile
11:12
15 - Overview of the client payment flows on Flutter web
6:29
16 - How to fulfil orders on the backend
6:58
17 - Showing the updated orders page in the Flutter app
5:42
18 - How to set and use the Stripe Secret Key with Cloud Functions
3:42
19 - Updating the available quantity on the Stripe product metadata
3:26
20 - Wrap Up
1:53
21 - Request for Feedback (optional)

Module 9

Full-Text Search with Algolia

In this module, we learn how to add full-text search with Algolia, Flutter, and Firebase to our eCommerce app. As part of this, we install the Algolia extension for Firebase, and optimize the client-side code by adding caching, debouncing, and realtime updates.

01 - Section Intro
1:30
02 - Overview of the Firebase Extensions for Full-Text Search
2:46
03 - Installing the Algolia Extension for Firebase
9:17
04 - Updated starter project and code walkthrough
5:58
05 - Adding the Algolia API keys to the Flutter project
2:28
06 - Implementing Products Search with Algolia
4:52
07 - Removing the loading indicator for a better search UX
3:54
08 - Using realtime updates when the query is empty
3:23
09 - Using caching and debouncing to make fewer API calls
5:31
10 - Wrap Up
1:47
11 - Request for Feedback (optional)

Module 10

Completing the eCommerce app

In this module, we complete the eCommerce app by deploying it as a Flutter web demo using Firebase Hosting. We also complete the product reviews feature, using Cloud Firestore and Cloud Functions on the backend.

01 - Section Intro
1:29
02 - Starter project and code walkthrough
3:11
03 - Implementing the ReviewsRepository
5:20
04 - Calculating the average rating score with Cloud Functions
5:45
05 - Deploying the Flutter web app with Firebase Hosting
3:10
06 - Updating the CORS policy for the deployed Flutter web app
2:35
07 - Conclusion
2:24
08 - Request for Feedback (optional)