Flutter idiomatic flutter
Skill ComeOnOliver/skillshub/skills/HoangNguyen0403/agent-skills-standard/flutter-idiomatic-flutter
Modern layout and widget composition standards. Use when composing Flutter widget trees, managing layout constraints, or following idiomatic Flutter patterns. (triggers: lib/presentation/**/*.dart, context.mounted, SizedBox, Gap, composition, shrink)From its SKILL.md
npx -y skills add ComeOnOliver/skillshub --skill flutter-idiomatic-flutterAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.5 KB, 303 tokens by cl100k_base, as published. Nobody here has run it
Idiomatic Flutter
Priority: P1 (OPERATIONAL)
Modern Flutter layout patterns and composition techniques.
- Async Gaps: Check
if (context.mounted)before usingBuildContextafterawait. - Composition: Extract complex UI into small widgets. Avoid deep nesting or large helper methods.
- Layout:
- Spacing: Use
Gap(n)orSizedBoxoverPaddingfor simple gaps. - Empty UI: Use
const SizedBox.shrink(). - Intrinsic: Avoid
IntrinsicWidth/Height; useStack+FractionallySizedBoxfor overlays.
- Spacing: Use
- Optimization: Use
ColoredBox/Padding/DecoratedBoxinstead ofContainerwhen possible. - Themes: Use extensions for
Theme.of(context)access.
Anti-Patterns
- ❌ No
if (context.mounted)afterawait— using BuildContext across async gaps causes crashes - ❌
Widget _buildHeader() { … }helper methods — extract to aconst StatelessWidgetfor proper rebuild control and DevTools profiling - ❌ Accessing a controller or state directly in a widget (
_controller.data) — use BLoC/Signals to decouple UI from state - ❌
Container(width: 0, height: 0)for empty space — useconst SizedBox.shrink()
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.