MutationState<T> class

Immutable state model for a mutation lifecycle.

Annotations

Constructors

MutationState.error(Object? error, [StackTrace? stackTrace])
Creates an error mutation state with error and optional stackTrace.
const
MutationState.idle()
Creates an idle mutation state.
const
MutationState.loading()
Creates a loading mutation state.
const
MutationState.queued()
Creates a queued mutation state for offline execution.
const
MutationState.success(T? data)
Creates a successful mutation state containing data.
const

Properties

data → T?
Mutation result data when successful.
final
error Object?
Error captured when mutation fails.
final
hasData bool
Whether successful data is currently available.
no setter
hasError bool
Whether an error is currently available.
no setter
hashCode int
The hash code for this object.
no setteroverride
isError bool
Whether the mutation finished with an error.
no setter
isIdle bool
Whether the mutation is idle.
no setter
isLoading bool
Whether the mutation is currently running.
no setter
isQueued bool
Whether this mutation is queued for later execution.
final
isSuccess bool
Whether the mutation finished successfully.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
Stack trace associated with error, if available.
final
status MutationStatus
Current lifecycle status.
final

Methods

copyWith({MutationStatus? status, T? data, Object? error, StackTrace? stackTrace, bool? isQueued}) MutationState<T>
Returns a copy of this state with selective overrides.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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