Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

building-flutter-appsbuilding Flutter apps 命令行

Agent Skill

building-flutter-apps 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,527

周安装

63

GitHub Stars

8

下载量

499
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:building-flutter-apps(building Flutter apps 命令行)
来源仓库:https://github.com/sgaabdu4/building-flutter-apps
仓库路径:skills/building-flutter-apps
安装命令:
npx skills add https://github.com/sgaabdu4/building-flutter-apps --skill building-flutter-apps
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sgaabdu4/building-flutter-apps --skill building-flutter-apps

简介

用于 Flutter 应用开发的全流程规范指导,涵盖架构、性能与安全最佳实践。

  • 适用于移动端跨平台项目,强制要求分析选项、状态管理与 Freezed 类的使用标准。
  • 禁止动态类型、硬编码字符串与抽象类配合 Freezed 的错误用法,提升代码健壮性。
  • 安装使用 GitHub 仓库,必须复制 analysis-options.md 与 architecture.md 至项目根目录。
  • building-flutter-apps 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

MANDATORY — Read Before Writing Any Code

Read this section + linked refs before code.

  1. MUST copy analysis-options.md analysis_options.yaml verbatim into every project root.
  2. MUST read architecture.md BEFORE creating any feature module, entity, model, datasource, or repository.
  3. MUST read freezed-sealed.md BEFORE creating any Freezed class.
  4. MUST read state-management.md BEFORE creating any notifier.
  5. MUST read performance.md BEFORE writing any widget tree or provider.
  6. NEVER use dynamic, _buildXxx() helpers, hardcoded strings, shrinkWrap: true, value!, or abstract class with Freezed.
  7. ALWAYS check if (!ref.mounted) return; after every await in notifiers.
  8. NEVER read state (incl. state.copyWith) in sync Notifier before build() returns. Seed via returned constructor, defer async init via Future.microtask. See state-management.md.
  9. ALWAYS init repositories inside mutation methods (create*, update*, delete*, set*, reorder*) via _ensureRepository()/_ensureDependencies() helper. NEVER rely only on build()/_init() timing for write paths.
  10. When touching guided tours, MUST read showcase-tours.md first. NEVER filter startShowCase() keys with key.currentContext checks.

Core Stack

PackagePurpose
flutter_riverpod + riverpod_annotation + riverpod_generatorState management (codegen)
freezed + freezed_annotationImmutable data classes, unions
go_router + go_router_builderDeclarative, type-safe routing
json_serializable + build_runnerJSON serialization + code generation
showcaseviewFirst-run guided tours
hive_ce + hive_ce_flutterLocal persistence

Architecture

graph LR
  P[Presentation] --> R[Repository]
  R --> Do[Domain]
  R --> Da[Data]
  Da -.-> Do
lib/
├── core/           # Shared: theme, utils, widgets, navigation, services
├── features/
│   └── feature_x/
│       ├── data/           # Models, datasources (API/local)
│       ├── domain/         # Entities (pure Dart, no dependencies)
│       ├── repositories/   # Map models → entities
│       └── presentation/   # Notifiers, screens, widgets
└── main.dart

Critical Rules

  1. Codegen only@riverpod / @Riverpod(keepAlive: true). NEVER legacy StateProvider, StateNotifierProvider.
  2. Sealed classessealed class with Freezed. NEVER abstract class.
  3. No prop drilling — child widgets watch providers direct.
  4. Guard asyncif (!ref.mounted) return; after EVERY await in notifiers. if (!context.mounted) return; in widgets.
  5. Single Ref — Riverpod 3.0 unified Ref types. NEVER AutoDisposeRef, FutureProviderRef.
  6. Select in leavesref.watch(provider.select((s) => s.field)) in leaf widgets.
  7. One primary class per file — exception: Freezed state + notifier may share file.
  8. Interface contractsabstract interface class for every repo + datasource. Constructors take interfaces, NEVER concrete types.
  9. No dynamic — use Object? or proper type. Exception: Map<String, dynamic> in JSON.
  10. Widget classes only — NEVER _buildXxx() helpers. Extract to named widget classes.
  11. No hardcoded strings*Strings constants classes with static const.
  12. ref.watch in build, ref.read in callbacks.
  13. Provider naming — codegen strips "Notifier": FooNotifierfooProvider.
  14. No shrinkWrap: true — use Sliver variants or constrained containers.
  15. Mixins for capabilities, interfaces for contracts — see mixins.md.
  16. No null-bang — NEVER value!. Use if (value case final v?).
  17. abstract final class for static-only namespaces — NEVER Class._(). Exception: const Entity._() in Freezed.
  18. ref.invalidate not ref.refresh when no return value needed.
  19. Persistence SSOT — Default to repository/data persistence. Notifier persistence opt-in. One persistence owner per feature state.
  20. Pop safely with GoRouter — For dismiss/back on pushable or deep-linkable screens, guard context.pop() with context.canPop(). If true, pop + return. Else navigate to typed fallback (const MyRoute().go(context)).
  21. No silent mutation no-op — Mutation methods must not return early just because cached repo field null; lazily init deps first, then proceed or fail explicit.
  22. Route-param safety in widgets — NEVER throw from widget build() for missing route IDs. Use nullable by-id providers + fallback UI. See common-patterns.md.
  23. Navigation-critical mutation sequencing — In wizard/deep-link flows: persist write → targeted state sync → navigate. See common-patterns.md and state-management.md.
  24. Showcase replay safety — Pass full ordered key list to startShowCase(). Do not gate by key.currentContext!= null / mounted checks; readiness is handled by scope registration + scheduling.

Provider Decision Tree

graph TD
  Q1{Repository, datasource, or service?} -->|Yes| A1["@Riverpod(keepAlive: true)"]
  Q1 -->|No| Q2{Feature notifier with mutable state?}
  Q2 -->|Yes| A2["@Riverpod(keepAlive: true) class XNotifier"]
  Q2 -->|No| Q3{Computed value or one-time fetch?}
  Q3 -->|Yes| Q5{All deps keepAlive?}
  Q5 -->|Yes| A5["@Riverpod(keepAlive: true)"]
  Q5 -->|No| A3["@riverpod — auto-disposes"]
  Q3 -->|No| Q4{Needs parameters?}
  Q4 -->|Yes| A4["Add params to function — family via codegen"]

Family + keepAlive caveat. Family + @Riverpod(keepAlive: true) keeps every key forever. Cache can grow unbounded. Prefer @riverpod.

Nested computed hop warning. Avoid computed -> computed chain in pause-sensitive paths (aProvider watches bProvider(param)). Riverpod 3.2.x offstage nav can throw TickerMode pause/resume assertion.

If chain required, flatten in parent provider:

  • watch base state directly
  • derive via pure helpers
  • avoid provider -> provider indirection on hot navigation paths

Exception: Riverpod 3.2.x has TickerMode assertion bug (rrousselGit/riverpod#4709). If hit, keepAlive: true workaround allowed. Add inline note: // keepAlive: Riverpod 3.2.x #4709 workaround. Remove after upstream fix.

Anti-Patterns

WrongRight
StateProvider@riverpod codegen
abstract class with Freezedsealed class
Pass state through constructorsChild watches provider directly
Missing ref.mounted after awaitif (!ref.mounted) return;
Auto-dispose with all-keepAlive deps@Riverpod(keepAlive: true)
Try-catch at every layerCatch once in notifier
context.go('/path') stringconst MyRoute().go(context) typed
Entity in datasourceModel with toEntity() in repo
Assume domain id equals backend row/document id in datasource update/deleteKeep ids separate. Resolve transport id first, then update/delete
@JsonSerializable(explicitToJson: true) per classexplicit_to_json: true in build.yaml
@Freezed(toJson: true) when fromJson existsPlain @freezed
Concrete type in constructorabstract interface class
value! null-bangif (value case final v?)
class Foo {Foo._();}abstract final class Foo
ref.refresh(provider) discarding returnref.invalidate(provider)
@Riverpod(keepAlive: true) on family provider@riverpod (auto-dispose)
Side-effect loading/error in notifier stateMutation<T>() — see riverpod-codegen.md
ref.read in initStateaddPostFrameCallback then read
state.copyWith(...) before first state= in sync Notifier.build() (incl. _load() called sync from build, or ref.listen(..., fireImmediately: true) callback that reads state)Seed via returned constructor + Future.microtask(_load), OR state = const FooState() before fireImmediately listener. See state-management.md
Mutation method (create*, update*, delete*, set*) does if (_repository == null) return...Use _ensureRepository()/_ensureDependencies() with await, then guard with if (!ref.mounted) return...
context.pop() without guard on dismiss/back callbacksif (context.canPop()) {context.pop(); return;} const MyRoute().go(context);
context.pop() then immediately push route (modal still animating)Navigator.of(context).maybePop().then((_) {if (ctx.mounted) nav();}) — see common-patterns.md
firstWhere(... orElse: () => throw StateError(...)) in widget build() for route IDsNullable by-id provider + fallback UI (no throw). See common-patterns.md
ref.invalidate(parentProvider) right after child create/delete in active wizard/deep-link flowPersist write → targeted parent sync → navigate. See state-management.md
using context after awaitif (!context.mounted) return;
Mixin vs interface vs extension choicesSee mixins.md

Full patterns: common-patterns.md | extensions-utilities.md

Class Modifiers

ModifierExtend outside libImplement outside libInstantiateMixin
abstract class
abstract interface class
abstract final class
sealed class
base class
interface class
final class
mixin class

Code Generation

dart run build_runner watch -d   # Watch mode (recommended)
dart run build_runner build -d   # One-time build
dart run build_runner clean && dart run build_runner build -d  # Clean build

References

Read before generating code for that topic.

FileWhen
performance.mdAlways — any widget or provider
architecture.mdFeature modules, layers, interfaces
riverpod-codegen.mdProviders, mutations, lifecycle
freezed-sealed.mdEntities, models, unions, serialization
state-management.mdNotifiers, error handling, cross-provider
analysis-options.mdEvery project — linter config
flutter-optimizations.mdScrolling, animation, concurrency
atomic-design.mdShared widgets in core/widgets/
testing.mdUnit/widget tests
dart-mcp-e2e-testing.mdDart MCP runtime E2E flow, logs, device targeting, fail/fix loop
common-patterns.mdLists, search, forms, GoRouter, sync
extensions-utilities.mdUtilities, extensions
mixins.mdMixin vs interface vs extension, retryWithBackoff + SaveAllRowsException for bulk I/O
hive-persistence.mdLocal storage, Hive adapters
services-and-singletons.mdStatic-only class vs singleton vs provider, fire-and-forget pattern, testing each
crashlytics.mdFirebase Crashlytics setup (3 hooks), Crash wrapper, non-fatal vs fatal, breadcrumbs, custom keys, symbols
showcase-tours.mdGuided tours, tour state sync, ProviderSubscription handle, test-env safe service read
dart-patterns-records.mdRecords, patterns, extension types

Pre-Flight — Before Returning Any Code

  • analysis_options.yaml from analysis-options.md in project root
  • if (!ref.mounted) return; after EVERY await in notifiers
  • if (!context.mounted) return; after EVERY await in widgets
  • No _buildXxx() helpers — extracted to widget classes
  • No hardcoded strings — *Strings constants classes
  • No dynamicObject? or proper types
  • No value! — if (value case final v?)
  • ref.watch() in build(), ref.read() only in callbacks
  • Sync Notifier.build() never reads state before first state= — loading flags seeded via returned constructor; async init dispatched with Future.microtask; no fireImmediately: true listener that reads state without prior direct state = assignment
  • Every notifier mutation method lazily inits repositories/deps (_ensureRepository/_ensureDependencies) before writes
  • Route-param lookups in widget build() are nullable (no throw-on-missing-id)
  • Wizard/deep-link mutation sequence: persist → targeted sync → navigate
  • If showcase code changed: startShowCase() uses full ShowcaseKeys.*Tour list (no key.currentContext filtering), and replay/reset path follows showcase-tours.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.85%
按下载量换算179

Claude

27.83%
按下载量换算139

Cursor

18.51%
按下载量换算92

Gemini CLI

8.64%
按下载量换算43

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills