Mutation<DataType, ErrorType, VariablesType> class
- Inheritance
-
- Object
- StateNotifier<
MutationState< DataType, ErrorType, VariablesType> > - Mutation
Constructors
-
Mutation(String key, MutationFn<
DataType, VariablesType> mutationFn, {required RetryConfig retryConfig})
Properties
- data → DataType?
-
no setter
-
dataStream
→ Stream<
DataType> -
no setter
-
debugState
→ MutationState<
DataType, ErrorType, VariablesType> -
A development-only way to access state outside of
StateNotifier
.no setterinherited - error → ErrorType?
-
no setter
-
errorStream
→ Stream<
ErrorType> -
no setter
- hasData → bool
-
no setter
- hasError → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasListeners → bool
-
If a listener has been added using addListener and hasn't been removed yet.
no setterinherited
- isInactive → bool
-
no setter
- isMutating → bool
-
no setter
- key → String
-
final
- mounted → bool
-
Whether dispose was called or not.
no setterinherited
-
mutationStream
→ Stream<
VariablesType> -
no setter
- onError ↔ ErrorListener?
-
A callback for error reporting if one of the listeners added with addListener throws.
getter/setter pairinherited
- retryConfig → RetryConfig
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
↔ MutationState<
DataType, ErrorType, VariablesType> -
The current "state" of this
StateNotifier
.getter/setter pairinherited -
stream
→ Stream<
MutationState< DataType, ErrorType, VariablesType> > -
A broadcast stream representation of a
StateNotifier
.no setterinherited
Methods
-
addListener(
Listener< MutationState< listener, {bool fireImmediately = true}) → RemoveListenerDataType, ErrorType, VariablesType> > -
Subscribes to this object.
inherited
-
cancellableRetryOperation(
FutureOr< DataType?> operation(), {required RetryConfig config, required void onSuccessful(DataType?), required void onFailed(ErrorType?)}) → CancelableOperation<void> -
inherited
-
cast<
NewDataType, NewErrorType, NewVariablesType> () → Mutation< NewDataType, NewErrorType, NewVariablesType> -
dispose(
) → void -
Frees all the resources associated to this object.
override
-
mutate(
VariablesType variables, {bool scheduleToQueue = false}) → Future< DataType?> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → Future< void> -
resolve(
Widget data(DataType data), {required Widget error(ErrorType error), required Widget loading(), Widget mutating()?, Widget offline()?}) → Widget -
resolveWith(
BuildContext context, Widget data(DataType data), {required Widget error(ErrorType error)?, required Widget loading()?, Widget offline()?, Widget mutating()?}) → Widget -
retryOperation(
FutureOr< DataType?> operation(), {required RetryConfig config, required void onSuccessful(DataType?), required void onFailed(ErrorType?)}) → Future<void> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateMutationFn(
MutationFn< DataType, VariablesType> mutationFn) → void -
updateShouldNotify(
MutationState< DataType, ErrorType, VariablesType> old, MutationState<DataType, ErrorType, VariablesType> current) → bool -
Whether to notify listeners or not when state changes
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override