AuthCheckTask class

A StartupTask that resolves the initial authentication state and seeds AuthenticationBloc.

Runs in StartupPhase.userAndSession and orchestrates a four-step sequence:

  1. Calls AuthRepository.resolveInitialStatus, which inspects the stored token and fetches the user. There are five possible outcomes:
  2. Adds StartupAuthResolved to AuthenticationBloc with the resolved status and user.
  3. Waits for the bloc to leave AuthenticationStatus.unknown, ensuring the startup result is fully processed before live listening begins.
  4. Adds StartLiveListening to activate the runtime auth and user streams.
Inheritance

Constructors

AuthCheckTask({required AuthRepository authRepository, required AuthenticationBloc authenticationBloc, required AppLogger logger})

Properties

hashCode int
The hash code for this object.
no setterinherited
id StartupTaskId
A unique identifier for this task, used for logging and ordering.
no setteroverride
label String
A short human-readable description shown on the splash screen while this task runs.
no setteroverride
phase StartupPhase
The startup phase this task belongs to.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute({void onSubProgress(double subFraction)?}) Future<void>
Performs the startup work for this task.
override
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