ChangeNotifierProvider<N extends ChangeNotifier> class
Use a NotifierProvider to implement a stateful provider.
Changes to the state are propagated to all consumers that
called watch
on the provider.
Constructors
- ChangeNotifierProvider(N _builder(Ref ref), {void onChanged(Ref)?, String? debugLabel, bool debugVisibleInGraph = true})
Properties
- customDebugLabel → String?
-
A custom label used by debug tools.
finalinherited
- debugLabel → String
-
A label to be used in debug messages and
by the
RefenaTracingPage
.no setterinherited - debugVisibleInGraph → bool
-
Set this flag to false to hide the provider from the
RefenaGraphPage
. By default, all providers are visible in the graph. However, some providers add unnecessary noise.finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
-
provider
→ BaseProvider<
N, void> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createState(
ProxyRef ref) → N -
getSelectedState(
N notifier, void state) → N -
The default behavior to return the notifier when
using
ref.watch(provider)
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overrideWithNotifier(
N builder(Ref ref)) → ProviderOverride< N, void> - Overrides with a predefined notifier.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
Subclasses should not override this method.
It is used internally by RefenaContainer to map a provider to a state.
inherited