UpdatingStatus<TState extends BlocState> class
Represents a successful state transition.
This is the most common status type, indicating that a use case completed successfully and the state has been updated.
Example:
if (status is UpdatingStatus) {
// Safe to display state data
return Text(bloc.state.data);
}
- Inheritance
-
- Object
- StreamStatus<
TState> - UpdatingStatus
- Available extensions
Constructors
- UpdatingStatus(TState state, TState oldState, EventBase? event)
-
Creates an updating status with the given state values.
const
Properties
- event → EventBase?
-
The event that triggered this status change, if any.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- oldState → TState
-
The previous state value before this status change.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → TState
-
The current state value.
finalinherited
Methods
-
copyWith(
{TState? state, TState? oldState, EventBase? event}) → StreamStatus< TState> -
Creates a copy of this status with optionally overridden values.
override
-
isCancelingFor<
S extends BlocState> () → bool -
Available on StreamStatus<
Returns true if this is a CancelingStatus for the given state type.BlocState> , provided by the StatusChecks extension -
isFailureFor<
S extends BlocState> () → bool -
Available on StreamStatus<
Returns true if this is a FailureStatus for the given state type.BlocState> , provided by the StatusChecks extension -
isUpdatingFor<
S extends BlocState> () → bool -
Available on StreamStatus<
Returns true if this is an UpdatingStatus for the given state type.BlocState> , provided by the StatusChecks extension -
isWaitingFor<
S extends BlocState> () → bool -
Available on StreamStatus<
Returns true if this is a WaitingStatus for the given state type.BlocState> , provided by the StatusChecks extension -
match<
S extends BlocState, R> ({required R updating(UpdatingStatus< S> ), required R waiting(WaitingStatus<S> ), required R canceling(CancelingStatus<S> ), required R failure(FailureStatus<S> ), required R orElse(StreamStatus<BlocState> )?}) → R -
Available on StreamStatus<
Type-safe pattern matching with an optional fallback.BlocState> , provided by the StatusChecks extension -
matchesState<
S extends BlocState> () → bool -
Available on StreamStatus<
Returns true if this status is for the given state type.BlocState> , provided by the StatusChecks extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
tryCastToCanceling<
S extends BlocState> () → CancelingStatus< S> ? -
Available on StreamStatus<
Attempts to cast this to CancelingStatus for the given state type. Returns null if the cast is not valid.BlocState> , provided by the StatusChecks extension -
tryCastToFailure<
S extends BlocState> () → FailureStatus< S> ? -
Available on StreamStatus<
Attempts to cast this to FailureStatus for the given state type. Returns null if the cast is not valid.BlocState> , provided by the StatusChecks extension -
tryCastToUpdating<
S extends BlocState> () → UpdatingStatus< S> ? -
Available on StreamStatus<
Attempts to cast this to UpdatingStatus for the given state type. Returns null if the cast is not valid.BlocState> , provided by the StatusChecks extension -
tryCastToWaiting<
S extends BlocState> () → WaitingStatus< S> ? -
Available on StreamStatus<
Attempts to cast this to WaitingStatus for the given state type. Returns null if the cast is not valid.BlocState> , provided by the StatusChecks extension -
when<
R> ({required R updating(TState state, TState oldState, EventBase? event), required R waiting(TState state, TState oldState, EventBase? event), required R canceling(TState state, TState oldState, EventBase? event), required R failure(TState state, TState oldState, EventBase? event)}) → R -
Pattern matches on the status type and executes the corresponding callback.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited