ProviderContainer class
ProviderContainer / Ref implementation
Holds provider state, overrides, and subscriptions.
Constructors
-
ProviderContainer({List<
Override> overrides = const [], List<ProviderObserver> observers = const []}) -
Creates a container with optional
overridesandobservers.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Disposes the container and all owned provider nodes.
-
getScope<
T> (Scope< T> s) → T -
Reads the value for
s, throwing if it is not provided. -
invalidate<
S> (ProviderBase< S> provider, {bool keepPrevious = true}) → void -
Invalidates
providerand optionally keeps the previous value. -
invoke<
R, State> (Call< R, State> call) → Future<R> - Executes a Call with its configured concurrency policy.
-
listen<
S> (ProviderBase< S> provider, void onData(S? previous, S next), {bool fireImmediately = false}) → ProviderSubscription<S> -
Subscribes to
providerchanges and returns a cancel handle. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read<
S> (ProviderBase< S> provider) → S -
Reads the current snapshot value of
provider. -
refresh<
T> (Provider< T> provider) → T - Rebuilds a synchronous Provider and returns its new value.
-
refreshValue<
T> (AsyncProvider< T> provider, {bool keepPrevious = true}) → Future<T> - Rebuilds an async AsyncProvider and returns its future value.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited