KCachedNotifier<In, Out> class

In is how the data get's stored Out is how the data is output

Inheritance

Constructors

KCachedNotifier(String _key, Out _defaultValue, {bool? isUpdateNotifying, FutureOr<Out> decode(In? data)?, FutureOr<In> encode(Out raw)?})

Properties

decode FutureOr<Out> Function(In? data)?
final
defaultValue → Out
no setter
encode FutureOr<In> Function(Out raw)?
final
future Future<Out>
Obtains a Future that resolves with the first state value that is not AsyncLoading.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isUpdateNotifying bool?
final
key String
no setter
ref Ref
The Ref associated with this notifier.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state AsyncValue<Out>
The value currently exposed by this notifier.
getter/setter pairinherited

Methods

build() Future<Out>
Initialize an AsyncNotifier.
override
listenSelf(void listener(AsyncValue<Out>? previous, AsyncValue<Out> next), {void onError(Object error, StackTrace stackTrace)?}) → RemoveListener
Listens to changes on the value exposed by this provider.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runBuild() → void
Executes Notifier.build.
inherited
set(Out value) Future<void>
toString() String
A string representation of this object.
inherited
update(FutureOr<Out> cb(Out previousState), {FutureOr<Out> onError(Object err, StackTrace stackTrace)?}) Future<Out>
A function to update state from its previous value, while abstracting loading/error cases for state.
inherited
updateIfNotEqual(Out value) Future<void>
updateShouldNotify(AsyncValue<Out> previous, AsyncValue<Out> next) bool
A method invoked when the state exposed by this Notifier changes. It compares the previous and new value, and return whether listeners should be notified.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited