AuthFlow<T extends AuthProvider<AuthListener, AuthCredential>> constructor

AuthFlow<T extends AuthProvider<AuthListener, AuthCredential>>({
  1. required AuthState initialState,
  2. required T provider,
  3. FirebaseAuth? auth,
  4. AuthAction? action,
})

A class that provides a current auth state given an AuthProvider and implements shared authentication process logic.

Should be rarely used directly, use available implementations instead:

See AuthFlowBuilder docs to learn how to wire up the auth flow with the widget tree.

Implementation

AuthFlow({
  /// An initial [AuthState] of the auth flow
  required this.initialState,

  /// {@template ui.auth.auth_flow.ctor.provider}
  /// An [AuthProvider] that is used to authenticate the user.
  /// {@endtemplate}
  required T provider,

  /// {@macro ui.auth.auth_controller.auth}
  fba.FirebaseAuth? auth,

  /// {@macro ui.auth.auth_action}
  AuthAction? action,
})  : auth = auth ?? fba.FirebaseAuth.instance,
      _action = action,
      _provider = provider,
      super(initialState) {
  _provider.authListener = this;
  _provider.auth = auth ?? fba.FirebaseAuth.instance;
}