What problem does it solve?
Helps developers choose and implement the right state management approach for Flutter apps so application state is predictable, testable, and scalable across screens and asynchronous data flows.
Core Features & Use Cases
- Decision guidance: A decision matrix mapping simple local state to setState, shared and async state to Riverpod, and complex event-driven flows to Bloc/Cubit.
- Practical implementation steps: Installation and integration patterns, ProviderScope usage, code generation with riverpod_generator and build_runner, and AsyncNotifier patterns for API-backed state.
- Testing and pitfalls: Recommendations for testing providers/blocs, common mistakes (ref.read vs ref.watch, missing ProviderScope, mutable states), and migration notes for Provider-based codebases.
- Use case example: Managing a shopping cart shared across screens with add/remove operations, persisted async fetches, and UI badges that update automatically.
Quick Start
Create a Riverpod CartNotifier with add, remove, and clear methods, wrap the app in ProviderScope, and use ref.watch(cartProvider) in the cart screen to display the item count.