SKILL

dart-flutter-patterns

生产就绪的Dart和Flutter模式,涵盖空安全、使用Freezed的不可变状态、异步组合、Widget架构、状态管理(BLoC、Riverpod、Provider)、带认证守卫的GoRouter导航、Dio网络、错误处理和测试。适用于编写或审查Dart和Flutter代码——状态、Widget、导航、网络或架构。

机器翻译
查看英文原文

Production-ready Dart and Flutter patterns covering null safety, immutable state with Freezed, async composition, widget architecture, state management (BLoC, Riverpod, Provider), GoRouter navigation with auth guards, Dio networking, error handling, and testing. Use when writing or reviewing Dart and Flutter code — state, widgets, navigation, networking, or architecture.

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

原作者说明节选

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

查看英文原文

原文涵盖的主题

  • Dart/Flutter Patterns
  • When to Use
  • How It Works
  • Examples
  • 1. Null Safety Fundamentals
  • Prefer Patterns Over Bang Operator
  • Avoid late Overuse
  • 2. Immutable State

Use this skill when: Starting a new Flutter feature and need idiomatic patterns for state management, navigation, or data access Reviewing or writing Dart code and need guidance on null safety, sealed types, or async composition Setting up a new Flutter project and choosing between BLoC, Riverpod, or Provider Implementing secure HTTP clients, WebView integration, or local storage Writing tests for Flutter widgets, Cubits, or Riverpod providers Wiring up GoRouter with authentication guards This skill provides copy-paste-ready Dart/Flutter code patterns organized by concern: 1. Null safety — avoid !, prefer ?./??/pattern matching 2. Immutable state — sealed classes, freezed, copyWith 3. Async composition — concurrent Future.wait, safe BuildContext after await 4. Widget architecture — extract to classes (not methods), const propagation, scoped rebuilds 5. State management — BLoC/Cubit events, Riverpod notifiers and derived providers 6. Navigation — GoRouter with reactive auth guards via refreshListenable 7. Networking — Dio with interceptors, token refresh with one-time retry guard 8. Error handling — global capture, ErrorWidget.builder, crashlytics wiring 9. Testing — unit (BLoC test

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

来源仓库
affaan-m/ECC
源文件
pi/core/skills/dart-flutter-patterns/SKILL.md
固定版本
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
阅读完整原作者说明 ↗

来源与内容状态

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

原作者:affaan-m/ECC · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T15:01:42.928Z。

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

许可与权利归属

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

许可原文 ↗

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

限制与注意事项

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