NotifierProviderElement<NotifierT extends NotifierBase<T>, T> class

The element of NotifierProvider.

Inheritance
Implemented types

Constructors

NotifierProviderElement(NotifierProviderBase<NotifierT, T> _provider)
The element of NotifierProvider.

Properties

container ProviderContainer
The ProviderContainer that owns this ProviderElementBase.
no setterinherited
debugAssertDidSetStateEnabled bool
Whether the assert that prevents requireState from returning if the state was not set before is enabled.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether this ProviderElementBase is currently listened to or not.
no setterinherited
mounted bool
Whether the element was disposed or not
no setterinherited
origin ProviderBase<Object?>
The provider associated with this ProviderElementBase, before applying overrides.
no setterinherited
provider ProviderBase<T>
The provider associated with this ProviderElementBase, after applying overrides.
no setterinherited
requireState → T
Read the current value of a provider and:
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildState() → void
Invokes create and handles errors.
inherited
create({required bool didChangeDependency}) → void
Initialize a provider.
override
debugReassemble() → void
A life-cycle executed when a hot-reload is performed.
inherited
dispose() → void
Release the resources associated to this ProviderElementBase.
inherited
exists(ProviderBase<Object?> provider) bool
Determines whether a provider is initialized or not.
inherited
flush() → void
A utility for re-initializing a provider when needed.
inherited
getState() → Result<T>?
Obtains the current state, or null if the provider has yet to initialize.
inherited
invalidate(ProviderOrFamily provider) → void
Invalidates the state of the provider, causing it to refresh.
inherited
invalidateSelf() → void
Invalidates the state of the provider, causing it to refresh.
inherited
listen<T>(ProviderListenable<T> listenable, void listener(T? previous, T value), {void onError(Object error, StackTrace stackTrace)?, bool fireImmediately = false, void onDependencyMayHaveChanged()?}) ProviderSubscription<T>
Listen to a provider and call listener whenever its value changes.
inherited
listenSelf(void listener(T? previous, T next), {void onError(Object error, StackTrace stackTrace)?}) → void
Listens to changes on the value exposed by this provider.
inherited
mayNeedDispose() → void
Life-cycle for when a listener is removed.
inherited
mount() → void
Called the first time a provider is obtained.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Notify dependents that this provider has changed.
inherited
onAddListener(void cb()) → void
A life-cycle for whenever a new listener is added to the provider.
inherited
onCancel(void cb()) → void
Add a listener to perform an operation when the last listener of the provider is removed.
inherited
onDispose(void listener()) → void
Adds a listener to perform an operation right before the provider is destroyed.
inherited
onRemoveListener(void cb()) → void
A life-cycle for whenever a listener is removed from the provider.
inherited
onResume(void cb()) → void
A life-cycle for when a provider is listened again after it was paused (and onCancel was triggered).
inherited
read<T>(ProviderListenable<T> provider) → T
Read the state associated with a provider, without listening to that provider.
inherited
readProviderElement<T>(ProviderBase<T> provider) ProviderElementBase<T>
Reads the state of a provider, potentially creating it in the process.
inherited
readSelf() → T
Returns the currently exposed by a provider
inherited
refresh<T>(Refreshable<T> provider) → T
Forces a provider to re-evaluate its state immediately, and return the created value.
inherited
runOnDispose() → void
Executes the Ref.onDispose listeners previously registered, then clear the list of listeners.
inherited
setState(T newState) → void
Update the exposed value of a provider and notify its listeners.
inherited
toString() String
A string representation of this object.
inherited
update(ProviderBase<T> newProvider) → void
Called when the override of a provider changes.
inherited
updateShouldNotify(T previous, T next) bool
Called when a provider is rebuilt. Used for providers to not notify their listeners if the exposed value did not change.
override
visitAncestors(void visitor(ProviderElementBase element)) → void
Visit the ProviderElementBases that this provider is listening to.
inherited
visitChildren({required void elementVisitor(ProviderElementBase element), required void notifierVisitor(ProxyElementValueNotifier element)}) → void
Visit the ProviderElements of providers that are listening to this element.
override
watch<T>(ProviderListenable<T> listenable) → T
Obtains the state of a provider and causes the state to be re-evaluated when that provider emits a new value.
inherited

Operators

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