Ref<State> class
Public ref passed to provider builders and mutations.
Properties
- container → ProviderContainer
-
The container backing this ref.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCancelled → bool
-
Whether the current mutation run has been cancelled.
no setter
- mounted → bool
-
Whether this ref is still mounted.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ↔ State
-
Reads the current state of the owning provider.
getter/setter pair
Methods
-
cache<
T> (Object key) → T? -
Reads a cached value for
key. -
cacheSet<
T> (Object key, T value) → void -
Stores a cached
valueforkey. -
checkCancelled(
) → void - Throws if this ref is cancelled.
-
emit<
T> (Stream< T> stream) → void -
Emits values from
streaminto an async provider. -
invalidate<
S> (ProviderBase< S> provider, {bool keepPrevious = true}) → void -
Invalidates
providerand optionally keeps the previous value. -
invoke<
R, S> (Call< R, S> call) → Future<R> - Invokes a mutation call in this container.
-
keepAlive(
) → KeepAliveLink - Prevents auto-dispose until the returned handle is closed.
-
listen<
S> (ProviderBase< S> provider, void onData(S? previous, S next), {bool fireImmediately = false}) → void -
Subscribes to
providerchanges for this ref's lifetime. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
void cb()) → void - Registers a callback to run when the provider is disposed.
-
read<
S> (ProviderBase< S> provider) → S -
Reads the current value of
providerwithout subscribing. -
refresh<
T> (Provider< T> provider) → T - Rebuilds a synchronous Provider and returns its new value.
-
refreshValue<
T> (AsyncProvider< T> provider, {bool keepPrevious = true}) → Future<T> - Rebuilds an async AsyncProvider and returns its future value.
-
scope<
T> (Scope< T> s) → T - Reads a scoped value.
-
toString(
) → String -
A string representation of this object.
inherited
-
watch<
S> (ProviderBase< S> provider) → S -
Watches
providerand rebuilds when it changes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited