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 value for key.
checkCancelled() → void
Throws if this ref is cancelled.
emit<T>(Stream<T> stream) → void
Emits values from stream into an async provider.
invalidate<S>(ProviderBase<S> provider, {bool keepPrevious = true}) → void
Invalidates provider and 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 provider changes 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 provider without 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 provider and rebuilds when it changes.

Operators

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