首页/ AI 技能 / @skilllib/skill-2014279408398315523
Skill站外收录 @skilllib/skill-2014279408398315523

idiomatic-flutter

倡导现代 Flutter 开发实践,强调上下文安全的异步处理、小粒度组件化构建、简洁间距控制(如 Gap)、空内容轻量占位(SizedBox.shrink),以及通过原语组合替代冗余容器,提升 UI 可维护性与性能。

0.0 (0) 570 次安装 原作者 编程导航
收录于 2026-01-22
软件开发 AI 技能

Skills.MD

# Idiomatic Flutter ## **Priority: P1 (OPERATIONAL)** Modern Flutter layout patterns and composition techniques. - **Async Gaps**: Check `if (context.mounted)` before using `BuildContext` after `await`. - **Composition**: Extract complex UI into small widgets. Avoid deep nesting or large helper methods. - **Layout**: - Spacing: Use `Gap(n)` or `SizedBox` over `Padding` for simple gaps. - Empty UI: Use `const SizedBox.shrink()`. - Intrinsic: Avoid `IntrinsicWidth/Height`; use `Stack` + `FractionallySizedBox` for overlays. - **Optimization**: Use `ColoredBox`/`Padding`/`DecoratedBox` instead of `Container` when possible. - **Themes**: Use extensions for `Theme.of(context)` access.

评论 0

还没有评论,来抢沙发。