notifier property

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

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

It is preferrable to do:

ref.watch(stateProvider.notifier)

instead of:

ref.read(stateProvider)

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

Implementation

late final AutoDisposeProviderBase<StateController<T>, StateController<T>>
    notifier = AutoDisposeProvider((ref) => ref.watch(this));