AutoDisposeStateProviderElement<State> class Null safety

The ProviderElementBase for StateProvider

Inheritance

Constructors

AutoDisposeStateProviderElement(AutoDisposeStateProvider<State> provider)
The ProviderElementBase for StateProvider

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 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<State>
The provider associated to this ProviderElementBase, before applying overrides.
read-onlyinherited
provider ProviderBase<State>
The provider associated to this ProviderElementBase, after applying overrides.
read-onlyinherited
requireState → State
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

addListener(ProviderBase<State> provider, void listener(State? previous, State next), {required bool fireImmediately, required void onError(Object error, StackTrace stackTrace)?}) ProviderSubscription<State>
inherited
dispose() → void
Called on ProviderContainer.dispose.
inherited
flush() → void
inherited
getState() → Result<State>?
inherited
listen<T>(ProviderListenable<T> listenable, void listener(T? previous, T value), {bool fireImmediately = false, void onError(Object error, StackTrace stackTrace)?}) → void Function()
Listen to a provider and call listener whenever its value changes.
inherited
markMustRecomputeState() → void
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 non-existent method or property is accessed.
inherited
onDispose(void listener()) → void
Adds a listener to perform an operation right before the provider is destroyed.
inherited
read<T>(ProviderBase<T> provider) → T
Read the state associated with a provider, without listening to that provider.
inherited
readSelf() → State
Returns the currently exposed by a provider
inherited
refresh<T>(ProviderBase<T> provider) → T
Re-create the state of a provider and return the new state.
inherited
setState(State newState) → void
inherited
toString() String
A string representation of this object.
inherited
update(ProviderBase<State> newProvider) → void
Called when the override of a provider changes.
inherited
visitAncestors(void visitor(ProviderElementBase element)) → void
Visit the ProviderElementBases that this provider is listening to.
inherited
visitChildren(void visitor(ProviderElementBase 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 cause the state to be re-evaluated when that provider emits a new value.
inherited

Operators

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