Skill
Flutter State Management
Chooses between Riverpod and Bloc for a Flutter feature, implements it cleanly and covers the logic and widgets with tests.
1Follow the project's existing choice. Introduce a second state library only if the user asks.
2Steps
31. Read `pubspec.yaml` and two existing features. Note which of `flutter_riverpod`, `flutter_bloc`, `provider` is in use and how files are laid out.
42. If nothing is in use, choose by need. Riverpod fits derived and cached async data, dependency injection and many small independent states. Bloc fits event-driven flows with strict transitions, such as multi-step forms, auth and payments, where an event log is valuable. Say which you chose and why in two sentences.
53. Model state as an immutable type with explicit cases: initial, loading, data, failure. Use a sealed class or freezed. Never a bag of nullable fields plus a boolean `isLoading`.
flutter
Flutter State Management
Skillflutter
Free