Riverpod 2 0 NotifierProvider Reactive State

Channel:
Subscribers:
135,000
Published on ● Video Link: https://www.youtube.com/watch?v=IUe0JLMmqCE



Duration: 6:30
849 views
27


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







Tags:
riverpod 2.0 notifier provider
riverpod 2.0 notifier
riverpod 2.0 notifierProvider