So, how do you use providers with Riverpod?
- Create the provider, giving it a name, type and body
- Update your widget to extend
ConsumerWidget
- Add a
WidgetRef
to the build method and use it to watch the provider - Use the value in your widget
More Riverpod tips incoming.👌
Found this useful? Show some love and share the original tweet 🙏
Previous | Next |
---|---|
Flutter Project Structure: Feature-first or Layer-first? | Using Fake Repositories for Testing |