ProviderElement<Created, Listened> class
An internal class that handles the state of a provider.
Do not use.
- Implemented types
- Implementers
Constructors
-
ProviderElement(ProviderBase<
Created, Listened> _provider) - Do not use.
Properties
- container → ProviderContainer
-
The ProviderContainer that owns this ProviderElement.
no setteroverride
-
dependents
→ Set<
ProviderElement> -
All the
ProviderElement
s that depend on thisProviderElement
.no setter - dirty → bool
-
Whether a provider may need to be recomputed
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether this ProviderElement is currently listened or not.
no setter
- mounted → bool
-
An utility to know if a provider was destroyed or not.
no setteroverride
-
origin
→ ProviderBase<
Created, Listened> -
The provider associated to this ProviderElement, before applying overrides.
no setter
-
provider
→ ProviderBase<
Created, Listened> -
The provider associated to this ProviderElement, after applying overrides.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
→ ProviderStateBase<
Created, Listened> -
final
Methods
-
dispose(
) → void - Called on ProviderContainer.dispose.
-
flush(
) → void - Compute the provider (if it needs to be recomputed) and returns whether a new value was created or not.
-
getExposedValue(
) → Listened - Returns the currently exposed by a provider
-
listen(
{void mayHaveChanged(ProviderSubscription< Listened> sub)?, void didChange(ProviderSubscription<Listened> sub)?}) → ProviderSubscription<Listened> - Listen to this provider.
-
markDidChange(
) → void - Notify that the state associated to this provider have changes. This will cause dependent widgets and providers to rebuild.
-
markMustRecomputeState(
) → void - Forces the state of a provider to be re-created, even if none of its dependencies changed.
-
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 nonexistent method or property is accessed.
inherited
-
notifyMayHaveChanged(
) → void - Notify that this provider may have changed.
-
onDispose(
void listener()) → void -
Adds a listener to perform an operation right before the provider is destroyed.
override
-
read<
T> (RootProvider< Object?, T> provider) → T -
Read the state associated with a provider, without listening to that provider.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
ProviderBase< Created, Listened> newProvider) → void - Called when the override of a provider changes.
-
watch<
T> (ProviderBase< Object?, T> provider) → 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