notifier property

  1. @override
AutoDisposeProviderBase<Notifier> notifier
final

Obtains the ChangeNotifier associated with this provider, but without listening to it.

Listening to this provider may cause providers/widgets to rebuild in the event that the ChangeNotifier it recreated.

It is preferrable to do:

ref.watch(changeNotifierProvider.notifier)

instead of:

ref.read(changeNotifierProvider)

The reasoning is, using read could cause hard to catch bugs, such as not rebuilding dependent providers/widgets after using ref.refresh on this provider.

Implementation

@override
final AutoDisposeProviderBase<Notifier> notifier;