AutoDisposeProviderElement<Created, Listened> class
Null safety
The ProviderElement of an AutoDisposeProviderBase.
- Inheritance
- Object
- ProviderElement<
Created, Listened> - AutoDisposeProviderElement
- Implemented types
Constructors
-
AutoDisposeProviderElement(ProviderBase<
Created, Listened> provider) - The ProviderElement of an AutoDisposeProviderBase.
Properties
- container → ProviderContainer
-
The ProviderContainer that owns this ProviderElement.
read-only, inherited
-
dependents
→ Set<
ProviderElement> -
All the
ProviderElement
s that depend on thisProviderElement
.read-only, inherited - dirty → bool
-
Whether a provider may need to be recomputed [...]
@protected, read-only, inherited
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- hasListeners → bool
-
Whether this ProviderElement is currently listened or not. [...]
read-only, inherited
- maintainState ↔ bool
-
Whether to destroy the state of the provider when all listeners are removed or not. [...]
read / write, override
- mounted → bool
-
An utility to know if a provider was destroyed or not. [...]
read-only, inherited
-
origin
→ ProviderBase<
Created, Listened> -
The provider associated to this ProviderElement, before applying overrides.
read-only, inherited
-
provider
→ ProviderBase<
Created, Listened> -
The provider associated to this ProviderElement, after applying overrides.
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
-
state
→ ProviderStateBase<
Created, Listened> -
final, inherited
Methods
-
dispose(
) → void -
Called on ProviderContainer.dispose.
@mustCallSuper, @protected, inherited
-
flush(
) → void -
Compute the provider (if it needs to be recomputed) and returns whether
a new value was created or not.
inherited
-
getExposedValue(
) → Listened -
Returns the currently exposed by a provider [...]
inherited
-
listen(
{void mayHaveChanged(ProviderSubscription< Listened> sub)?, void didChange(ProviderSubscription<Listened> sub)?}) → ProviderSubscription<Listened> -
Listen to this provider. [...]
inherited
-
markDidChange(
) → void -
Notify that the state associated to this provider have changes.
This will cause dependent widgets and providers to rebuild.
@protected, inherited
-
markMustRecomputeState(
) → void -
Forces the state of a provider to be re-created, even if none of its
dependencies changed.
inherited
-
mayNeedDispose(
) → void -
Life-cycle for when a listener is removed. [...]
override
-
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
-
notifyMayHaveChanged(
) → void -
Notify that this provider may have changed. [...]
@protected, inherited
-
onDispose(
void listener()) → void -
Adds a listener to perform an operation right before the provider is destroyed. [...]
inherited
-
read<
T> (RootProvider< Object?, T> provider) → T -
Read the state associated with a provider, without listening to that provider. [...]
inherited
-
toString(
) → String -
A string representation of this object. [...]
inherited
-
update(
ProviderBase< Created, Listened> newProvider) → void -
Called when the override of a provider changes. [...]
@mustCallSuper, @protected, inherited
-
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. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited