CancelingStatus<TState extends BlocState> class

Represents an operation that was cancelled.

Used when a CancellableEvent is cancelled during execution. The UI can use this to show cancellation feedback or restore previous state.

Example:

if (status is CancelingStatus) {
  return Text('Operation cancelled');
}
Inheritance
Available extensions

Constructors

CancelingStatus(TState state, TState oldState, EventBase? event)
Creates a canceling 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<BlocState>, provided by the StatusChecks extension

Returns true if this is a CancelingStatus for the given state type.
isFailureFor<S extends BlocState>() → bool

Available on StreamStatus<BlocState>, provided by the StatusChecks extension

Returns true if this is a FailureStatus for the given state type.
isUpdatingFor<S extends BlocState>() → bool

Available on StreamStatus<BlocState>, provided by the StatusChecks extension

Returns true if this is an UpdatingStatus for the given state type.
isWaitingFor<S extends BlocState>() → bool

Available on StreamStatus<BlocState>, provided by the StatusChecks extension

Returns true if this is a WaitingStatus for the given state type.
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<BlocState>, provided by the StatusChecks extension

Type-safe pattern matching with an optional fallback.
matchesState<S extends BlocState>() → bool

Available on StreamStatus<BlocState>, provided by the StatusChecks extension

Returns true if this status is for the given state type.
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<BlocState>, provided by the StatusChecks extension

Attempts to cast this to CancelingStatus for the given state type. Returns null if the cast is not valid.
tryCastToFailure<S extends BlocState>() → FailureStatus<S>?

Available on StreamStatus<BlocState>, provided by the StatusChecks extension

Attempts to cast this to FailureStatus for the given state type. Returns null if the cast is not valid.
tryCastToUpdating<S extends BlocState>() → UpdatingStatus<S>?

Available on StreamStatus<BlocState>, provided by the StatusChecks extension

Attempts to cast this to UpdatingStatus for the given state type. Returns null if the cast is not valid.
tryCastToWaiting<S extends BlocState>() → WaitingStatus<S>?

Available on StreamStatus<BlocState>, provided by the StatusChecks extension

Attempts to cast this to WaitingStatus for the given state type. Returns null if the cast is not valid.
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