MutationFailure<TData, TVariables> class final

Failure state — mutation failed.

Inheritance
Available extensions
Annotations

Constructors

MutationFailure({required Object error, required TVariables variables, StackTrace? stackTrace})
const

Properties

dataOrNull → TData?
The result data if the mutation succeeded, otherwise null.
no setterinherited
error → Object
The error that occurred.
final
errorOrNull → Object?
The error if the mutation failed, otherwise null.
no setterinherited
hashCode → int
The hash code for this object.
no setteroverride
isError → bool
Returns true if the last mutation failed.
no setterinherited
isIdle → bool
Returns true if no mutation has been run (or after reset).
no setterinherited
isOptimistic → bool
true when the success state is optimistic — the mutation was enqueued offline and has not yet been confirmed by the server.
no setterinherited
isPending → bool
Returns true if a mutation is actively running.
no setterinherited
isSuccess → bool
Returns true if the last mutation completed successfully.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackTrace → StackTrace?
Optional stack trace for debugging.
final
status → MutationStatus

Available on MutationState<TData, TVariables>, provided by the MutationStateExtensions extension

Converts this state to a simple MutationStatus enum.
no setter
variables → TVariables
The variables used in this mutation call.
final
variablesOrNull → TVariables?
The variables used in the last mutation call, or null if idle.
no setterinherited

Methods

fold<R>({required R onIdle(), required R onPending(TVariables variables), required R onSuccess(TData data, TVariables variables), required R onError(Object error, StackTrace? stackTrace, TVariables variables)}) → R

Available on MutationState<TData, TVariables>, provided by the MutationStateExtensions extension

Exhaustive fold — maps every state to a value of type R.
maybeWhen<R>({required R orElse(), R onIdle()?, R onPending(TVariables variables)?, R onSuccess(TData data, TVariables variables, bool isOptimistic)?, R onError(Object error, StackTrace? stackTrace, TVariables variables)?}) → R
Maps the state to a value of type R.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
when({void onIdle()?, void onPending(TVariables variables)?, void onSuccess(TData data, TVariables variables, bool isOptimistic)?, void onError(Object error, StackTrace? stackTrace, TVariables variables)?}) → void
Executes a callback based on the current state.
inherited

Operators

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