Mutation<T> class
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
AsyncSnapshot< T> > - Mutation
Constructors
-
Mutation({AsyncSnapshot<
T> initialState = const AsyncSnapshot.nothing()})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isData → bool
-
no setter
- isError → bool
-
no setter
- isIdle → bool
-
no setter
- isLoading → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
↔ AsyncSnapshot<
T> -
The current value stored in this notifier.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
maybeWhen<
R> ({AsyncIdleCallback< R> ? idle, AsyncDataCallback<R, T> ? data, AsyncErrorCallback<R> ? error, AsyncLoadingCallback<R> ? loading, required R orElse()}) → R -
mutate<
R> (Future< T> future(), {required BuildContext context, AsyncLoadingCallback<R> ? loading, AsyncDataCallback<R?, T> ? data, AsyncErrorCallback<R?> ? error}) → Future<R?> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
R> ({required AsyncIdleCallback< R> idle, required AsyncDataCallback<R, T> data, required AsyncErrorCallback<R> error, required AsyncLoadingCallback<R> loading}) → R -
whenData<
R> (AsyncDataCallback< R?, T> ? data) → R? -
whenError<
R> (AsyncErrorCallback< R?> ? error) → R? -
whenIdle<
R> (AsyncIdleCallback< R?> ? idle) → R? -
whenLoading<
R> (AsyncLoadingCallback< R?> ? loading) → R? -
whenMutated<
R> ({required AsyncDataCallback< R, T> data, required AsyncErrorCallback<R> error}) → R -
whenOrNull<
R> ({AsyncIdleCallback< R?> ? idle, AsyncDataCallback<R?, T> ? data, AsyncErrorCallback<R?> ? error, AsyncLoadingCallback<R?> ? loading}) → R?
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited