riverpod
riverpod copied to clipboard
Request to add update state method to Notifier
Is it possible to add updateState to Notifier just like it was present in StateProvider?
ref.read(provider.notifier).update((state) => state + 1);
Currently as per documentation the only way to get this is by adding the below to every Class Notifier. There are many Notifier<bool>
that is used which will require the update function
T update(T Function(T state) cb) => state = cb(state);