ProviderElementBase<State> class Null safety

An internal class that handles the state of a provider.

Do not use.

Implemented types
Implementers

Constructors

ProviderElementBase(ProviderBase<State> _provider)
Do not use.

Properties

container ProviderContainer
The ProviderContainer that owns this ProviderElementBase.
read-onlyoverride
debugAssertDidSetStateEnabled bool
Whether the assert that prevents requireState from returning if the state was not set before is enabled.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
hasListeners bool
Whether this ProviderElementBase is currently listened or not.
read-only
mounted bool
Whether the element was disposed or not
read-only
origin ProviderBase<State>
The provider associated to this ProviderElementBase, before applying overrides.
read-only
provider ProviderBase<State>
The provider associated to this ProviderElementBase, after applying overrides.
read-only
requireState → State
read-only
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>
dispose() → void
Called on ProviderContainer.dispose.
flush() → void
getState() → Result<State>?
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.
override
markMustRecomputeState() → void
mayNeedDispose() → void
Life-cycle for when a listener is removed.
mount() → void
Called the first time a provider is obtained.
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.
override
read<T>(ProviderBase<T> provider) → T
Read the state associated with a provider, without listening to that provider.
override
readSelf() → State
Returns the currently exposed by a provider
refresh<T>(ProviderBase<T> provider) → T
Re-create the state of a provider and return the new state.
override
setState(State newState) → void
toString() String
A string representation of this object.
override
update(ProviderBase<State> newProvider) → void
Called when the override of a provider changes.
visitAncestors(void visitor(ProviderElementBase element)) → void
Visit the ProviderElementBases that this provider is listening to.
visitChildren(void visitor(ProviderElementBase element)) → void
Visit the ProviderElements of providers that are listening to this element.
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.
override

Operators

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