HopeMutationState<TData> class
The state of a running mutation. Received inside HopeMutationBuilder.
builder: (context, state, mutate) {
if (state.isMutating) return CircularProgressIndicator();
if (state.isError) return Text(state.error.toString());
return ElevatedButton(onPressed: () => mutate(variables), child: Text('Submit'));
}
Properties
- data → TData?
-
The result returned from a successful mutation. Null otherwise.
final
- error → Object?
-
The error from a failed mutation. Null otherwise.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
True when the mutation failed.
final
- isIdle → bool
-
True before the mutation has been called for the first time.
no setter
- isMutating → bool
-
True while the mutation request is in progress.
final
- isSuccess → bool
-
True when the mutation completed successfully.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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