Firebase + Flutter sample apps with code snippets, supported by comprehensive articles for each implementation.

Overview

FlutterFire Samples

This repo is created to contain various sample apps demonstrating the integration of Firebase with Flutter. The final goal is to create something like the Flutter Gallery app, but for Firebase.

Also, the recently changes introduced in Flutter 2 create some confusion, mostly with the beginners, as many other repositories are not yet updated to the latest version. Even FlutterFire plugins got a lot of improvements and most of them support null safety now.

NOTE: This entire repo uses the latest Flutter 2.0 stable release, with null safety enabled, for creating the sample apps.

If you like the content of this repository, please don't forget to this.

🚧 WIP to add all types of Firebase samples in this repo.

Currently the repo contains:

The master branch is currently having the implementation for Firebase Authentication (using Google Sign-In), but it will soon be updated.

Contents

The aim of this repo is to include examples for:

  • Authentication

    • Email & password registration & login
    • Login using various providers (Google, GitHub, Apple, etc.)*
    • Phone OTP verification
  • Database

    • CRUD operations on Firebase Cloud Firestore
    • Storing & retrieving images/videos/files to/fro Cloud Storage
    • Using Realtime Database
  • Backend Actions

    • Cloud Functions
    • User Presence tracking
    • Push notifications using Firebase Cloud Messaging (FCM)
  • Machine Learning

    • Test recognition
    • Face detection
    • Image recognition (more might be added here)
  • Other utilities

    • Analytics/Crashlytics
    • Remote config
    • A/B testing
    • In-app messaging
    • Dynamic Linking
    • Firebase extensions (BETA)

*Only Google Sign-In implemented currently.


Current master branch description

This is a sample app demonstrating Firebase Authentication in Flutter using email & password. Also shows how to send email verification and set up auto login.

NOTE: This sample app uses the latest Flutter 2.0 stable release, with null safety enabled. Make sure you are using Flutter 2 in order to prevent any build errors. Tested on Android, iOS & Web.

App in action 🚀 :

Plugins

For this project you have to add two plugins:

  • firebase_core: Required for initializing Firebase and using any other Firebase plugins.
  • firebase_auth: For using Firebase Authentication service in Flutter.

The latest version of both these plugins support null safety.

Usage

If you want to try out the this sample app, first you have to create and configure a Firebase project:

  • Clone the project:

    https://github.com/sbis04/flutterfire-samples.git
  • Create a new Firebase project from the console.

  • Configure the Firebase for each platform.

  • Run the app using the command:

    cd flutterfire-samples
    flutter run

License

Copyright (c) 2021 Souvik Biswas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • User presence tracking (Realtime database + Cloud functions)

    User presence tracking (Realtime database + Cloud functions)

    Showcase the user's presence tracking (online/offline) tracking, an example use case can be in any chat application. You can follow this blog to implement it.

    Please try to maintain similar theming across the pages, though there aren't any concrete theming guidelines for this contribution but keep this in mind for future-proofing this contribution.

    Use the correct folder structure for adding the functionality, have a look at the readme and the project lib folder structure to understand the proper folder structure to follow. Each functionality is under its own category and consists mainly of screens, utils, and widgets folders.

    NOTE: You need to create your own Firebase project and configure it before starting to contribute, make sure you read the CONTRIBUTING guidelines.

    Assume the Realtime Database & Cloud Firestore rules to be open to everyone (even without auth) for this demo.

    More info: https://blog.codemagic.io/user-presence-in-cloud-firestore-with-flutter Package to use: https://pub.dev/packages/firebase_database, https://pub.dev/packages/cloud_firestore

    Hacktoberfest 2022 Note: There's no assignment of issues (first come, first review basis), all eligible contributions will be given “hacktoberfest-accepted” label to make it count towards the Hacktoberfest contribution, even if it's not merged.

    enhancement help wanted good first issue Hacktoberfest 
    opened by sbis04 2
  • I can't see the users database

    I can't see the users database

    Your project is really great! 👍

    I have cloned it and tested it on iOS to understand the concept of Firebase. All works fine and looks good, but I don't know how to access the list of registered users in the Firebase console. Can you help me with that?

    Thanks in advance!

    opened by MuratovArthur 1
  • When emulating on Android, spinning icon never stops.

    When emulating on Android, spinning icon never stops.

    I am assuming that something is going wrong when authenticating through the Android emulator, but I am not sure what. I am using AVD Manager emulating a Pixel Q 10.0 (API 29). When I attempt to sign-in with Google it will allow me to select the user I want to sign in with, but then the spinning loading icon never completes.

    When I emulate this on Web it works perfectly fine. I am unable to test on iOS.

    opened by ScottishRoss 1
  • Added Browser Dependency

    Added Browser Dependency

    Everytime, I pressed for OTP my app crashing.Finally,this thing help me out. Now,browser can be opened up easily for verification. This change basically allow firebase to access the mobile browser for verfication.

    opened by sxmeer-ahmed 1
  • Solved Password Invalid Issue due to Pre & Post Spaces

    Solved Password Invalid Issue due to Pre & Post Spaces

    Hello, Om Here,

    While running the project I get to know that there is an issue with Firebase Authentication implementation and that is while auto-completing passwords including extra space at the end which is included in the password, leading to the wrong password while entering again.

    So, I solved that issue by removing extra space from both sides and updating the code.

    PR Includes Changes in the Following Files

    1. sign_in_form.dart
    2. register_form.dart
    3. authentication.dart

    Applied trim() operation on all the data before passing it to the actual function. that solved the issue...

    Thanks for creating such real helpful project. Please merge this PR because it might cause issues for other people.

    I am looking forward contribute more to this repo...

    Happy Coding, Thank You -- Om Jogani

    hacktoberfest-accepted 
    opened by omjogani 0
  • Can't able to signOut after adding the Auto Login logic in initializeFirebase()

    Can't able to signOut after adding the Auto Login logic in initializeFirebase()

    I did the process as per your article https://blog.codemagic.io/firebase-authentication-google-sign-in-using-flutter/ . It is working fine with the SignIn and SignOut process. But when I added the auto-login logic whenever I tried to SigOut by pressing the signout button, it is going to the sign_in_screen but suddenly it is again Sign in me to the user_info_screen. How to solve this?

    opened by swayamshreemohanty 0
  • Implement Multi Factor Authentication (MFA)

    Implement Multi Factor Authentication (MFA)

    Showcase the new Firebase authentication method called Multi Factor Authentication (MFA), it gives users a more secure way of authentication. You can take the help of the Invertase blog present below inside the More info section.

    Please try to maintain similar theming across the pages, though there aren't any concrete theming guidelines for this contribution but keep this in mind for future-proofing this contribution.

    Use the correct folder structure for adding the functionality, have a look at the readme and the project lib folder structure to understand the proper folder structure to follow. Each functionality is under its own category and consists mainly of screens, utils, and widgets folders.

    NOTE: You need to create your own Firebase project and configure it before starting to contribute, make sure you read the CONTRIBUTING guidelines.

    More info: https://invertase.io/blog/flutterfire-mfa-tutorial Package to use: https://pub.dev/packages/firebase_auth

    Hacktoberfest 2022 Note: There's no assignment of issues (first come, first review basis), all eligible contributions will be given “hacktoberfest-accepted” label to make it count towards the Hacktoberfest contribution, even if it's not merged.

    enhancement help wanted good first issue Hacktoberfest 
    opened by sbis04 0
  • Realtime Database: Showcase CRUD operations

    Realtime Database: Showcase CRUD operations

    Showcase the CRUD operation using the Firebase Realtime Database. You can follow the implementation of the Cloud Firestore CRUD operation and just build a similar thing with Realtime Database, or come up with your own idea (but should be a simple implementation that touches on all the CRUD operations).

    Please try to maintain similar theming across the pages, though there aren't any concrete theming guidelines for this contribution but keep this in mind for future-proofing this contribution.

    Use the correct folder structure for adding the functionality, have a look at the readme and the project lib folder structure to understand the proper folder structure to follow. Each functionality is under its own category and consists mainly of screens, utils, and widgets folders.

    NOTE: You need to create your own Firebase project and configure it before starting to contribute, make sure you read the CONTRIBUTING guidelines.

    Assume the Realtime Database rules to be open to everyone (even without auth) for this demo.

    More info: https://firebase.google.com/docs/database/flutter/start Package to use: https://pub.dev/packages/firebase_database

    Hacktoberfest 2022 Note: There's no assignment of issues (first come, first review basis), all eligible contributions will be given “hacktoberfest-accepted” label to make it count towards the Hacktoberfest contribution, even if it's not merged.

    enhancement help wanted good first issue Hacktoberfest 
    opened by sbis04 2
  • Cloud Storage: Add image/video/file storage implementation

    Cloud Storage: Add image/video/file storage implementation

    Add functionality for retrieving an image, video, or other files from the device storage and upload it to Cloud Storage. Use the generated URL to provide an option to download the file on the second page.

    So, there would be two pages basically:

    • First Page to select and upload a file from the device
    • Second Page to download the file to the device

    Please try to maintain similar theming across the pages, though there aren't any concrete theming guidelines for this contribution but keep this in mind for future-proofing this contribution.

    Use the correct folder structure for adding the functionality, have a look at the readme and the project lib folder structure to understand the proper folder structure to follow. Each functionality is under its own category and consists mainly of screens, utils, and widgets folders.

    NOTE: You need to create your own Firebase project and configure it before starting to contribute, make sure you read the CONTRIBUTING guidelines.

    Assume the Cloud Storage rule to be open to everyone (even without auth) for this demo.

    More info: https://firebase.google.com/docs/storage/flutter/start Package to use: https://pub.dev/packages/firebase_storage

    Hacktoberfest 2022 Note: There's no assignment of issues (first come, first review basis), all eligible contributions will be given “hacktoberfest-accepted” label to make it count towards the Hacktoberfest contribution, even if it's not merged.

    enhancement help wanted good first issue Hacktoberfest 
    opened by sbis04 4
Owner
Souvik Biswas
Android, iOS & Flutter Developer | C++, Java and Dart Programmer | Technical Writer @Medium & @NevercodeHQ | @udacity Secure and Private AI '19 Scholar
Souvik Biswas
Flutter-based mobile app displaying a list of daily curated content from top engineering blogs and articles. Backed by a GraphQL-based API written in Kotlin..

Flutter-based mobile app displaying a list of daily curated content from top engineering blogs and articles. Backed by a GraphQL-based API written in Kotlin..

Armel Soro 20 Dec 14, 2022
A collection of sample apps that use Stream

Flutter samples Quick Links Register to get an API key for Stream Chat Flutter Chat Tutorial Chat UI Kit Flutter SDK Repo What is Stream? Stream allow

Stream 247 Dec 21, 2022
Sample that produces the following issue with Firebase Database web in Flutter

issue_rtdb_controller_already_firing_event Sample that produces the following issue with Firebase Database web in Flutter. @firebase/database: Error:

Deepak Goyal 0 Oct 25, 2021
A Flutter app with firebase libraries implementation

FlutFire A Flutter project with implementation of all firebase libraries for Android and iOS both. Show some ❤️ and star the repo to support the proje

Pawan Kumar 644 Dec 20, 2022
Learn how to incorporate Firebase into our Flutter apps

Flash Chat ⚡️ Our Goal The objective of this tutorial is to learn how to incorporate Firebase into our Flutter apps. We'll be using Firebase Cloud Fir

null 0 Oct 27, 2021
Flutter: QR Code Scanner App Flutter: QR Code Scanner App

Flutter QRCode Scanner APP Show some ❤️ and star the repo to support the project A new Flutter project. Features Scan 2D barcodes Scan QR codes Contro

Pawan Kumar 250 Nov 10, 2022
Flutter Advanced: Background Fetch | Run code in the background Android & iOS | Run code in the background Android & iOS

flutterbackground A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you starte

Pawan Kumar 40 Dec 16, 2022
Sample flutter app for getting started with the Amplify Flutter Library.

Amplify Flutter Example Sample flutter app for getting started with the Amplify Flutter Library. This example uses the Auth, Analytics, and Storage co

Dao Hong Vinh 10 Jan 19, 2022
Flutter Multichannel Packaging Detail Sample Project

Flutter 多渠道打包详解 多渠道打包介绍 多渠道打包的主要作用是满足产品的运营需求,统计渠道和活动效果。 在之前原生(Android、iOS)开发 App 有各种工具来辅助我们完成多渠道打包。 在我们开发过程中也需要为渠道功能负责,原生的开发工具就基本满足我们调试渠道包内容,但是在 Flutt

Zero 25 Jun 27, 2022
A sample Google Chrome browser extension built in flutter web

My Activities It is a sample Google Chrome browser extension The extension was built in Flutter Web. How to build % cd /path/to/project/root % flutter

Viktor BORBÉLY 3 Nov 12, 2021
This is a sample Flutter Weather Forecast App for Android and iOS.

Basic Flutter (Android + iOS) App (Dart + Dio) - Weather App This is a very beginning friendly project of Flutter. A simple weather forecast App using

Hasan Abdullah 31 Nov 29, 2022
💙 A simple Flutter app sample with hooks_riverpod, includes HTTP requests by dio using GitHub APIs.

?? A simple Flutter app sample with hooks_riverpod, includes HTTP requests by dio using GitHub APIs.

Kosuke Saigusa 16 Oct 13, 2022
This project is by taking the sample application of the

debo_eyu A new Flutter project. Any one who want to contact me, use my email [email protected] or on my telegram account using @LindaAug1 let's se

Eyosiyas Tibebu 1 Oct 15, 2021
Sample project for an employee management application.

HR App Sample project for an employee management application. Getting Started Choose a storage implementation to be used. The application currently su

Pásztor Dániel 4 Jul 14, 2022
An (Sample)app that allows users to donate their pets and adopt others pets.

PetApp An (Sample)app that allows users to donate their pets and adopt others pets. About I created this app to learn more about Flutter and UI/UX in

VIDIT SINGH BRAHAMANIA 33 Oct 5, 2022
(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.

(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.

Ismael Shakverdiev 45 Jul 14, 2022
Simple product management app, with Auth module made with Firebase Auth and Firebase Firestore ODM

Firestore App Simple product management app, with Auth module made with Firebase Auth and Firebase Firestore ODM. You can login or signup with email o

null 3 Jun 24, 2022
An Login Page App in Flutter with MVP and SQFLITE ( SQLITE) Implementation.

Flutter SQFLITE MVP LOGIN APP A Login Page Flutter App with SQFLITE (SQLITE) and MVP implementation. Written in dart using Flutter SDK. Please don't f

Pawan Kumar 179 Jan 4, 2023
A simple flutter app with demo implementation of redux.

Flutter Redux Tutorial Redux Project is just a quick guide for implementation of redux.dart and flutter_redux . Written in dart using Flutter SDK. Ple

Pawan Kumar 46 Jun 16, 2022