SKILL

flutter-state-management

Choose and correctly use Flutter state management with current (2026) APIs - Riverpod 3 (Notifier/AsyncNotifier, mutations, Ref.mounted), BLoC/Cubit 9 (flutter_bloc), Flutter's official MVVM with ChangeNotifier + Commands, and built-ins (setState, ValueNotifier, ListenableBuilder); plus why to avoid GetX. Use this whenever the user writes or reviews a Cubit, Bloc, provider, Notifier, ViewModel or StatefulWidget, asks "BLoC or Riverpod?", handles loading/error states or one-off effects (snackbar, navigation), uses BuildContext after await, or hits rebuild/async bugs in Flutter, even if they don't say "state management".

原文 · 译文尚未补齐

适用对象:移动应用开发。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • Flutter state management
  • 1. Pick one (per codebase) and record why
  • 2. Load only the reference you need
  • 3. Universal async rules (all libraries)
  • 4. Review checklist
  • Sources

Verified against official docs and pub.dev on 2026-09-25: Flutter 3.47 / Dart 3.13, flutterriverpod 3.4, flutterbloc 9.1 / bloc 9.2, provider 6.1. The rules that matter more than the library: ephemeral (UI) state stays in the widget, shared business state lives outside it; every async operation has explicit loading/data/error; one-off effects are not state. | | Pick when | Cost | |---|---|---| | Riverpod 3 (most downloaded: 3.3M/30d) | You want DI + state + caching in one tool; async-heavy data; compile-safe dependencies; less boilerplate | Flexible, so the team must enforce boundaries or the provider graph sprawls | | Bloc / Cubit 9 (2M/30d) | Large teams, strict and traceable state transitions, event transformations (debounce, droppable), regulated or long-lived apps | More boilerplate | | ChangeNotifier MVVM + provider (Flutter's official architecture guide) | You want to follow docs.flutter.dev exactly, fewest dependencies, a team new to Flutter | You hand-write Commands/Result; less tooling | | setState, ValueNotifier + ValueListenableBuilder, ListenableBuilder, flutterhooks | Ephemeral state: selected tab, form input, animation, text controllers, expanded/collapsed | Doesn't

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
abugeek/flutter-skills
源文件
.claude/skills/flutter-state-management/SKILL.md
固定版本
458377635834ad1cff2c4871ac0725a5ef4bcd4f
阅读完整原作者说明 ↗

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:abugeek/flutter-skills · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-10T09:01:53.929Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。