MutationSnapshot<TData, TError, TVariables> class
sealed
A Dart-idiomatic, exhaustively matchable snapshot of a mutation's state.
Unlike MutationResult, this is a sealed hierarchy: a switch over it is
checked for exhaustiveness, data is non-nullable on MutationSuccess,
error is non-nullable on MutationError, and variables is non-nullable
on every variant except MutationIdle.
The four variants mirror MutationStatus: MutationIdle (never invoked),
MutationPending, MutationSuccess, and MutationError. The
TOnMutateResult type parameter carried by MutationResult is internal and
never surfaced, so it is dropped here.
This is an experimental API and may change in a future minor release.
- Implementers
Properties
- dataOrNull → TData?
-
The resolved data, if the mutation succeeded.
no setter
- failureCount → int
-
The number of times the current mutation has failed.
final
- failureReason → TError?
-
The error from the most recent failed mutation attempt.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
Whether the mutation is in an error state.
no setter
- isIdle → bool
-
Whether the mutation has not been invoked yet.
no setter
- isPaused → bool
-
Whether the mutation is paused (typically offline).
final
- isPending → bool
-
Whether the mutation is currently executing.
no setter
- isSuccess → bool
-
Whether the mutation completed successfully.
no setter
-
mutate
→ Mutate<
TVariables> -
A fire-and-forget function that executes the mutation.
final
-
mutateAsync
→ MutateAsync<
TData, TVariables> -
A function that executes the mutation and returns a Future.
final
- reset → Reset
-
Resets the mutation to its initial idle state.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- submittedAt → DateTime?
-
The timestamp when the mutation was submitted.
final
- variablesOrNull → TVariables?
-
The variables of the most recent mutation, if one has been invoked.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited