InitialState<T> class

Represents the initial state of a Bloc.

Inheritance

Constructors

InitialState()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isFailure bool
Checks if the current state is FailureState.
no setterinherited
isInitial bool
Checks if the current state is InitialState.
no setterinherited
isLoading bool
Checks if the current state is LoadingState.
no setterinherited
isSuccess bool
Checks if the current state is SuccessState.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
successData → T?
Gets the success data if available, otherwise returns null
no setterinherited

Methods

map<R extends Object?>({required R initialState(InitialState<T> initialState), required R loadingState(LoadingState<T> loadingState), required R successState(SuccessState<T> successState), required R failureState(FailureState<T> failureState)}) → R
Maps the current state to a specific function based on its type.
inherited
mapSuccessData<R>(R mapper(T data)) → R?
Transforms success data if state is success, otherwise returns null
inherited
maybeMap<R extends Object?>({required R orElse(), R initialState(InitialState<T> initialState)?, R loadingState(LoadingState<T> loadingState)?, R successState(SuccessState<T> successState)?, R failureState(FailureState<T> failureState)?}) → R
Executes a specific function based on the current state, or a default function if the state does not match.
inherited
maybeWhen<R extends Object?>({required R orElse(), R initialState()?, R loadingState(String? message, double? progress)?, R successState(T successObject)?, R failureState(String? failureMessage, dynamic exception, VoidCallback? retryCallback)?}) → R
Executes a specific function based on the current state, or a default function if the state does not match.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<R extends Object?>({required R initialState(), required R loadingState(String? message, double? progress), required R successState(T successObject), required R failureState(String? failureMessage, dynamic exception, VoidCallback? retryCallback)}) → R
Executes a specific function based on the current state.
inherited

Operators

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