ViewProvider<T> class

The ViewProvider is the only provider that can watch other providers. Its builder is similar to a normal Provider. A common use case is to define a view model that depends on many providers. Don't worry about the ref, you can use it freely inside any function. The ref will never become invalid.

Constructors

ViewProvider.new(T builder(WatchableRef ref), {String? debugLabel})

Properties

customDebugLabel String?
finalinherited
debugLabel String
A label to be used in debug messages and by the RiverpieTracingPage.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
provider → BaseProvider<ViewProviderNotifier<T>, T>
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareIdentity(LabeledReference other) bool
Compares the identity of two LabeledReferences.
inherited
createState(Ref ref) ViewProviderNotifier<T>
getSelectedState(ViewProviderNotifier<T> notifier, T state) → T
The default behavior to return the whole state when using ref.watch(provider).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideWithBuilder(T builder(WatchableRef)) ProviderOverride<ViewProviderNotifier<T>, T>
select<R>(R selector(T state)) → SelectedWatchable<ViewProviderNotifier<T>, T, R>
Used for ref.watch(provider.select(...)). Select a part of the state.
inherited
toString() String
A string representation of this object.
inherited

Operators

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