ProviderReference class

An object used by providers to interact with other providers and the life-cycles of the application.

See also:

  • read and watch, two methods that allows a provider to consume other providers.
  • mounted, an utility to know whether the provider is still "alive" or not.
  • onDispose, a method that allows performing a task when the provider is destroyed.
Annotations

Constructors

ProviderReference()

Properties

container ProviderContainer
The ProviderContainer that this provider is associated with.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
mounted bool
An utility to know if a provider was destroyed or not. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onDispose(void cb()) → void
Adds a listener to perform an operation right before the provider is destroyed. [...]
read<T>(RootProvider<Object, T> provider) → T
Read the state associated with a provider, without listening to that provider. [...]
toString() String
Returns a string representation of this object.
inherited
watch<T>(AlwaysAliveProviderBase<Object, T> provider) → T
Obtains the state of a provider and cause the state to be re-evaluated when that provider emits a new value. [...]

Operators

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