Riverpod 2 0 NotifierProvider Reactive State
Let's see how to use Riverpod 2.0 Notifier Provider for reactive state and change state of the app.
Here we will first create a class and our class would extend Notifier. With notifier you need to mention your state variable type.
In this case we will have a string and it should be reactive. so we will mention it.
Next we also have to override the build method. Build method should return string type since our Notifier is return type.
You may understand it the other way, Since build method returns String type, Notifier should return String too.
And after that we need to expose our state to the outside world. We will do that using NotifierProvider.
NotifierProvider would take our custom class and Notifier type.
Everything about Riverpod 2.0 is here
https://www.dbestech.com/tutorials/flutter-riverpod-new-version