Ref class abstract interface Introduction

A Ref is used to access the state of providers. It lives as long as the RefenaContainer lives since it is just a proxy to access the state.

To access low-level methods, you can use Ref.container.

Implementers
Available Extensions

Constructors

Ref()

Properties

container RefenaContainer
Returns the backing container. The container exposes more advanced methods for edge cases.
no setter
debugOwnerLabel String
Returns the owner of this Ref. Usually, this is a notifier or a widget. Used by Ref.redux to log the origin of the action.
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

accessor<R>(BaseWatchable<BaseNotifier, dynamic, R> provider) StateAccessor<R>
Similar to Ref.read, but instead of returning the state right away, it returns a StateAccessor to get the state later.
dispose<N extends BaseNotifier<T>, T>(BaseProvider<N, T> provider) → void
Disposes a provider. Be aware that streams (ref.stream) are closed also. You may call this method in the dispose method of a stateful widget. Calling this method multiple times has no effect. Note: The provider will be initialized again on next access.
disposeFamilyParam<N extends FamilyNotifier<dynamic, P, dynamic>, P>(BaseProvider<N, dynamic> provider, P param) → void
Disposes the param of a family provider. While the ordinary dispose method disposes the whole provider, this method only disposes the param. Calling this method multiple times has no effect.
future<N extends GetFutureNotifier<T>, T>(ProviderAccessor<BaseProvider<N, AsyncValue<T>>, N, AsyncValue<T>> provider) Future<T>
Get the Future of an AsyncNotifierProvider, FutureProvider or StreamProvider.
message(String message) → void
Emits a message to the observer. This might be handy if you use RefenaTracingPage.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifier<N extends BaseNotifier<T>, T>(NotifyableProvider<N, T> provider) → N
Get the notifier of a provider.
read<N extends BaseNotifier<T>, T, R>(BaseWatchable<N, T, R> watchable) → R
Get the current value of a provider without listening to changes.
rebuild<N extends RebuildableNotifier<T, R>, T, R>(RebuildableProvider<N, T, R> provider) → R
Rebuilds a rebuildable provider (e.g. ViewProvider, FutureProvider) and returns the result of the builder function.
redux<N extends ReduxNotifier<T>, T>(ReduxProvider<N, T> provider) Dispatcher<N, T>
Get a proxy class to dispatch actions to a ReduxNotifier.
stream<N extends BaseNotifier<T>, T>(ProviderAccessor<BaseProvider<N, T>, N, T> provider) Stream<NotifierEvent<T>>
Listen for changes to a provider.
toString() String
A string representation of this object.
inherited

Operators

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