AutoDisposeProviderElement<T> class

The element of AutoDisposeProvider

Inheritance
Implemented types

Properties

container ProviderContainer
The ProviderContainer that owns this ProviderElementBase.
read-onlyinherited
debugAssertDidSetStateEnabled bool
Whether the assert that prevents requireState from returning if the state was not set before is enabled.
read-onlyinherited
hashCode int
The hash code for this object.
read-onlyinherited
hasListeners bool
Whether this ProviderElementBase is currently listened to or not.
read-onlyinherited
maintainState bool
Whether to destroy the state of the provider when all listeners are removed or not.
read / writeinherited
mounted bool
Whether the element was disposed or not
read-onlyinherited
origin ProviderBase<Object?>
The provider associated with this ProviderElementBase, before applying overrides.
read-onlyinherited
provider ProviderBase<T>
The provider associated with this ProviderElementBase, after applying overrides.
read-onlyinherited
requireState → T
Read the current value of a provider and:
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
state ↔ T
Obtains the state currently exposed by this provider.
read / writeinherited

Methods

buildState() → void
Invokes create and handles errors.
inherited
create({required bool didChangeDependency}) → void
Initialize a provider.
inherited
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
keepAlive() KeepAliveLink
Requests for the state of a provider to not be disposed when all the listeners of the provider are removed.
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 depedents 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.
inherited
visitAncestors(void visitor(ProviderElementBase<Object?> element)) → void
Visit the ProviderElementBases that this provider is listening to.
inherited
visitChildren({required void elementVisitor(ProviderElementBase<Object?> element), required void notifierVisitor(ProxyElementValueNotifier<Object?> element)}) → void
Visit the ProviderElements of providers that are listening to this element.
inherited
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