Skip to content

This form and validation functions are created by using the BLOC pattern with RxDart instead of using StatefulWidget

Notifications You must be signed in to change notification settings

sparky005/flutter-form-with-validation-BLOC

 
 

Repository files navigation

BLOC Pattern Login Form

A login form with validation created with Flutter.

Getting Started

For help getting started with Flutter, view our online documentation.

About the app

  • This form and validation functions are created by using the BLOC pattern with RxDart instead of using StatefulWidget

This app covers the following concepts from flutter, Dart and RxDart:

  • BLOC pattern to share information/state in the app between different sections/screens
  • Concept of Single Global Instance BLOC and Scoped Instance BLOC based on the scale of the app
  • Single Global Instance: Single source of truth of your app state
  • Scoped Instance: Multiple sources of truth divided based on sections/screens of the app
  • StreamBuilder Widget to access streams/methods in the Bloc from another Widget
  • Intro to RxDart for additional functionalities on Stream and StreamController
  • Dart(Stream) => RxDart(Observable), Dart(StreamController) => RxDart(Subject)
  • Using RxDart Observable to merge streams as one for form submission
  • Concept of Single-Subscription Stream and Broadcast Stream
  • Intro to BehaviorSubject to replace StreamController.broadcast for additional function to go back in time to retrieve the latest stream values for form submission
  • Best practice on adding dispose function in Bloc class for the ability to close streams (or IDE might complain with warning)
  • Best practice on setting StreamController as private instance method to avoid confusion from newcomers working on the same project

About

This form and validation functions are created by using the BLOC pattern with RxDart instead of using StatefulWidget

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 86.6%
  • Objective-C 9.0%
  • Java 4.4%