AuthStateChangeAction<T extends AuthState> class

An action that is called when auth state changes. You can capture any type of AuthState using this action.

For example, you can perform navigation after user has signed in:

SignInScreen(
  actions: [
    AuthStateChangeAction<SignedIn>((context, state) {
      Navigator.pushReplacementNamed(context, '/home');
    }),
  ],
);
Inheritance

Constructors

AuthStateChangeAction(void callback(BuildContext context, T state))
An action that is called when auth state changes. You can capture any type of AuthState using this action.

Properties

callback → void Function(BuildContext context, T state)
A callback that is being called when underlying auth flow transitioned to a state of type T.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

invoke(BuildContext context, T state) → void
Invokes the callback with the provided context and state.
matches(AuthState state) bool
Verifies that a current state is a T
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited