
Flutter Use Column Row First
Use when building any Flutter screen or component to choose responsive Row, Column...
Install
npx skills add evanca/flutter-ai-rules --skill flutter-use-column-row-first -g -a claude-code -y- Repository
- evanca/flutter-ai-rules668
- Category
- Mobile
- Updated
- 5d ago
- License
- MIT
- Context cost
- Lightabout 1,270 tokens
- Runs scripts
- No, instructions only
What it does
Use when building any Flutter screen or component to choose responsive Row, Column, Expanded, Flexible, and Spacer layouts before fixed-size or coordinate-based alternatives.
Flutter Use Column Row First
Build responsive Flutter layouts from the constraint system outward. Prefer simple flex composition and introduce fixed dimensions or overlays only when the design requires them for a concrete purpose.
Layout workflow
- Identify each group as primarily vertical, horizontal, overlapping, scrolling, or wrapping.
- Start vertical groups with
Columnand horizontal groups withRow. - Nest small, named widgets instead of building one deeply nested
buildmethod. - Use
Expanded,Flexible, andSpacerto distribute bounded free space. - Add padding, alignment, aspect ratio, and constraints intentionally.
- Test narrow and wide constraints, text scaling, keyboard appearance, and long or localized content.
Rules
- Prefer
Columnfor vertical flow andRowfor horizontal flow. - Control alignment with
mainAxisAlignment,crossAxisAlignment, andmainAxisSize. - Use
Expandedwhen a child must fill its allocated share of remaining main-axis space. - Use
Flexiblewhen a child may use less than its allocated share. - Use
flexonly to express proportional allocation. A child withflex: 2receives twice the free-space share of a sibling withflex: 1. - Use
Spacerfor flexible separation between siblings. UseSizedBoxfor deliberate, fixed gaps. - Wrap text or other variable-width content in
ExpandedorFlexibleinside aRowwhen it must yield space to siblings. - Use
ListViewor another scrollable when vertical content can exceed the viewport;Columndoes not scroll. - Use
Wrapwhen horizontal children should move onto another run instead of shrinking or overflowing. - Use
LayoutBuilder, breakpoints, or adaptive widgets when the composition itself must change with available space. - Use
SafeAreawhen content must avoid system intrusions.
Avoid rigid layouts
Avoid these as default layout mechanisms:
