Skip to content

Flutter State Management Comparison: [ setState ❖ BLoC ❖ ValueNotifier ❖ Provider ]

License

Notifications You must be signed in to change notification settings

bizz84/simple_auth_comparison_flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

State Management Comparison: Authentication Flow

This sample app shows different approaches to managing state in Flutter:

Use case: Setting a loading state while an authentication request is in progress

YouTube video walkthrough

Flutter State Management: setState, BLoC, ValueNotifier, Provider

Also published as an article here.

Preview

Overview

Flutter offers various state management approaches.

This project implements a simple use case with different techniques. A Drawer menu can be used to switch between them.

This serves both as an introduction and a comparison of different approaches.

Currently supported

  • vanilla (basic implementation without loading state)
  • setState
  • BLoC with Provider
  • ValueNotifier with Provider

Running the project with Firebase

To use this project with Firebase authentication, some configuration steps are required.

  • Create a new project with the Firebase console.
  • Add iOS and Android apps in the Firebase project settings.
  • On Android, use com.codingwithflutter.simple_auth_comparison_flutter as the package name.
  • then, download and copy google-services.json into android/app
  • On iOS, use com.codingwithflutter.simpleAuthComparisonFlutter as the bundle ID
  • then, download and copy GoogleService-Info.plist into iOS/Runner, and add it to the Runner target in Xcode

References


All the state management techniques used in this project are explained in great detail, and implemented step-by-step in my Flutter & Firebase Udemy course.

This is available for early access at this link (discount code included):

About

Flutter State Management Comparison: [ setState ❖ BLoC ❖ ValueNotifier ❖ Provider ]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published