Best Practices: When to Use StateNotifier vs AsyncNotifier in Riverpod 2.x #177147
-
BodyIm building a Flutter app with Riverpod 2.x, and I’m a bit confused about when to use StateNotifier versus AsyncNotifier.my state sometimes depends on async operations (like API calls) but also needs to hold sync data that updates based on those results should I just use one type everywhere, or is it better to mix them? How do you structure your state logic to keep it clean and maintainable? Guidelines
|
Beta Was this translation helpful? Give feedback.
Answered by
drdixit
Oct 16, 2025
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
raw-dogging
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's no strict rule, its more about keeping your logic clear and maintainable