ChangeNotifierProvider<T extends ChangeNotifier> class Null safety

Creates a ChangeNotifier and subscribes to it.

Note: By using Riverpod, ChangeNotifier will no-longer be O(N^2) for dispatching notifications, but instead O(N)

Inheritance
Annotations

Constructors

ChangeNotifierProvider(Create<T, ProviderReference> _create, {String? name})
Creates a ChangeNotifier and subscribes to it. [...]

Properties

argument Object?
If this provider was created with the .family modifier, argument is variable used.
read-only, inherited
debugId String
A unique identifier for this provider, used by devtools to differentiate providers [...]
final, read / write, inherited, late
from Family<dynamic, dynamic, dynamic, ProviderReference, RootProvider>?
If this provider was created with the .family modifier, from is the .family instance.
read-only, inherited
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
name String?
A custom label for providers. [...]
final, inherited
notifier AlwaysAliveProviderBase<T, T>
Obtains the ChangeNotifier associated with this provider, but without listening to it. [...]
final, late
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

create(ProviderReference ref) → T
override
createElement() ProviderElement<T, T>
An internal method that defines how a provider behaves.
inherited
createState() → _ChangeNotifierProviderState<T>
An internal method that creates the state of a provider.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
overrideWithProvider(AlwaysAliveProviderBase<Object?, T> provider) → ProviderOverride
Overrides the behavior of this provider with another provider. [...]
inherited
overrideWithValue(T value) Override
Overrides the behavior of a provider with a value. [...]
select<Selected>(Selected selector(T value)) ProviderListenable<Selected>
Partially listen to a provider. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

autoDispose → const AutoDisposeChangeNotifierProviderBuilder
Marks the provider as automatically disposed when no-longer listened. [...]
const AutoDisposeChangeNotifierProviderBuilder()
family → const ChangeNotifierProviderFamilyBuilder
A group of providers that builds their value from an external parameter. [...]
const ChangeNotifierProviderFamilyBuilder()