AuthAuthenticated<T> class
State representing a successfully authenticated session with user data.
Constructors
- AuthAuthenticated(T user)
-
Creates an AuthAuthenticated state with
user.const
Properties
- hasError → bool
-
Whether an authentication error has occurred.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- isAuthenticated → bool
-
Whether a user is currently authenticated.
no setterinherited
- isAuthenticating → bool
-
Whether an authentication request is in progress.
no setterinherited
- isUnauthenticated → bool
-
Whether the user is currently unauthenticated.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- user → T
-
The authenticated user data object.
final
- userOrNull → T?
-
The active user object if authenticated, or
nullotherwise.no setterinherited
Methods
-
maybeWhen<
R> ({R unauthenticated()?, R authenticating()?, R authenticated(T user)?, R error(Object error, StackTrace stackTrace)?, required R orElse()}) → R -
Pattern-matches with an
orElsefallback for unhandled states.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
when<
R> ({required R unauthenticated(), required R authenticating(), required R authenticated(T user), required R error(Object error, StackTrace stackTrace)}) → R -
Exhaustively pattern-matches all four auth states.
inherited
-
whenOrNull<
R> ({R unauthenticated()?, R authenticating()?, R authenticated(T user)?, R error(Object error, StackTrace stackTrace)?}) → R? -
Pattern-matches and returns
nullfor unhandled states.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override