StateProviderElement<State> class

Inheritance

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 or not.
no setterinherited
mounted bool
Whether the element was disposed or not
no setterinherited
origin ProviderBase<State>
The provider associated to this ProviderElementBase, before applying overrides.
no setterinherited
provider ProviderBase<State>
The provider associated to this ProviderElementBase, after applying overrides.
no setterinherited
requireState → State
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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 nonexistent 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