StateProviderElement<State> class Null safety

The ProviderElementBase for StateProvider

Inheritance

Constructors

StateProviderElement(StateProvider<State> provider)
The ProviderElementBase for StateProvider

Properties

container ProviderContainer
The ProviderContainer that owns this ProviderElementBase.
read-only, inherited
debugAssertDidSetStateEnabled bool
Whether the assert that prevents requireState from returning if the state was not set before is enabled.
@visibleForOverriding, read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
hasListeners bool
Whether this ProviderElementBase is currently listened or not. [...]
read-only, inherited
mounted bool
Whether the element was disposed or not
@visibleForTesting, read-only, inherited
origin ProviderBase<State>
The provider associated to this ProviderElementBase, before applying overrides.
read-only, inherited
provider ProviderBase<State>
The provider associated to this ProviderElementBase, after applying overrides.
read-only, inherited
requireState → State
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

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.
@mustCallSuper, @protected, 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. [...]
mount() → void
Called the first time a provider is obtained.
@mustCallSuper, @protected, 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. [...]
@mustCallSuper, @protected, 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