WidgetRef class abstract


WidgetRef API

Public API for reading and watching providers in widgets.

Constructors

WidgetRef()

Properties

container ProviderContainer
The current ProviderContainer.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

invalidate<S>(ProviderBase<S> provider, {bool keepPrevious = true}) → void
Invalidates provider and optionally keeps previous values.
invoke<R, S>(Call<R, S> call) Future<R>
Invokes a mutation call in this container.
listen<S>(ProviderBase<S> provider, void listener(S? previous, S next), {bool fireImmediately = false}) ProviderSubscription<S>
Listens to provider changes and returns a subscription handle.
listenManual<S>(ProviderBase<S> provider, void listener(S? previous, S next), {bool fireImmediately = false}) ProviderSubscription<S>
Listens to provider without tying the subscription to rebuilds.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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 new future value.
scope<T>(Scope<T> token) → T
Reads a scoped value from the nearest ProviderScope.
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