MutationState<T> class

Represents the state of a mutation

This class is immutable and provides convenient getters for common states.

Annotations

Constructors

MutationState.error(Object error)
Factory constructor for an error state.
factory
MutationState.idle()
Factory constructor for an initial idle state.
factory
MutationState.loading()
Factory constructor for a loading state.
factory
MutationState.success(T data)
Factory constructor for a success state.
factory

Properties

data → T?
The data returned by the mutation. Null if no data has been returned.
final
error Object?
The error encountered during the mutation, if any
final
hashCode int
The hash code for this object.
no setteroverride
isError bool
True if the mutation encountered an error.
no setter
isIdle bool
True if the mutation is in its initial state.
no setter
isLoading bool
True if the mutation is currently executing.
no setter
isSuccess bool
True if the mutation completed successfully.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status MutationStatus
The current status of the mutation (e.g., loading, success, error)
final

Methods

copyWith({T? data, Object? error, MutationStatus? status}) MutationState<T>
Creates a copy of this MutationState with updated values.
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