Skip to main content
skill CX Codex

flutter-use-column-row-first — Claude Code skill: install

The flutter-use-column-row-first skill guides Flutter screen layouts with Row, Column, and flexible space. Use it when building a screen that must adapt to different constraints.

MIT ★ 674 updated 2026-10-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rules
Open on GitHub

What flutter-use-column-row-first does

The skill starts by sorting each UI group by its layout: vertical, horizontal, overlapping, scrollable, or wrapping. It then guides the choice of Column and Row, distributes available space with Expanded, Flexible, or Spacer, and applies padding and constraints deliberately. When a narrow screen makes a horizontal layout unusable, it recommends changing the composition at a breakpoint rather than squeezing the children.

It also covers overflow diagnosis, nested columns, and content that needs scrolling. The suggested checks include viewport width, text scaling, the keyboard, and long localized strings. Column does not scroll, and Expanded or Flexible with non-zero flex needs a bounded main axis; using them in an unbounded vertical scroll area can break the layout. Fixed sizes and Positioned have a place when they serve a clear purpose, such as sizing an icon or placing a badge.

What it helps with

  • Compose Flutter screens from vertical and horizontal groups
  • Allocate remaining space among child widgets
  • Prevent long text from overflowing a Row
  • Choose scrolling or wrapping for content that does not fit
  • Check a screen against narrow layout constraints

Example prompts for the agent

  • Build a Flutter settings screen with Column and Row for its sections.
  • Check this Row for overflow and let the text widget use Flexible.
  • Fix the nested Column so it takes the available height in the screen.

How to install flutter-use-column-row-first

1Plugin marketplace

/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rules

This installs the whole flutter-ai-skills plugin with all its skills

2Skills CLI (Vercel)

npx skills add evanca/flutter-ai-rules --skill flutter-use-column-row-first -a claude-code

3Manually: put the files in place

~/.claude/skills/flutter-use-column-row-first/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/flutter-use-column-row-first/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about flutter-use-column-row-first

How do I install flutter-use-column-row-first in Claude Code?

Add the marketplace with /plugin marketplace add evanca/flutter-ai-rules, then install the skill with /plugin install flutter-ai-skills@flutter-ai-rules.

What does flutter-use-column-row-first do?

It guides Flutter layouts built with Row, Column, and flexible widgets, and helps choose scrolling or wrapping when content does not fit.

Why can Expanded fail inside a scrollable area?

A vertical scrollable has an unbounded main axis. Expanded and Flexible with non-zero flex need a finite constraint along that axis.

Source text

SKILL.md · MIT
---
name: flutter-use-column-row-first
description: 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.
license: MIT
---

# 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

1. Identify each group as primarily vertical, horizontal, overlapping, scrolling, or wrapping.
2. Start vertical groups with `Column` and horizontal groups with `Row`.
3. Nest small, named widgets instead of building one deeply nested `build` method.
4. Use `Expanded`, `Flexible`, and `Spacer` to distribute bounded free space.
5. Add padding, alignment, aspect ratio, and constraints intentionally.
6. Test narrow and wide constraints, text scaling, keyboard appearance, and long or localized content.

## Rules

- Prefer `Column` for vertical flow and `Row` for horizontal flow.
- Control alignment with `mainAxisAlignment`, `crossAxisAlignment`, and `mainAxisSize`.
- Use `Expanded` when a child must fill its allocated share of remaining main-axis space.
- Use `Flexible` when a child may use less than its allocated share.
- Use `flex` only to express proportional allocation. A child with `flex: 2` receives twice the free-space share of a sibling with `flex: 1`.
- Use `Spacer` for flexible separation between siblings. Use `SizedBox` for deliberate, fixed gaps.
- Wrap text or other variable-width content in `Expanded` or `Flexible` inside a `Row` when it must yield space to siblings.
- Use `ListView` or another scrollable when vertical content can exceed the viewport; `Column` does not scroll.
- Use `Wrap` when 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 `SafeArea` when content must avoid system intrusions.

## Avoid rigid layouts

Avoid these as default layout mechanisms:

- `Stack` with hardcoded `Positioned` coordinates
- `Container`, `SizedBox`, or `ConstrainedBox` with hardcoded screen-like width or height
- offsets, transforms, or margins used to simulate normal document flow
- screen dimensions copied from a mockup

Use them when they serve a concrete purpose, such as:

- true visual overlap, badges, floating controls, or anchored decoration
- touch-target minimums, icon sizes, thumbnails, or bounded media
- intentional maximum reading width
- aspect-ratio requirements
- platform or design-system constants

State the purpose in the code structure or a brief comment when it is not obvious.

## Constraint safety

- Put `Expanded` and `Flexible` only under `Row`, `Column`, or `Flex`.
- Do not use non-zero flex along an unbounded main axis. In a vertical scrollable, remove vertical `Expanded` or `Flexible`, or establish a meaningful finite constraint.
- Fix a nested `Column` that needs the outer column's remaining height by wrapping the inner column in `Expanded`.
- Diagnose overflow by inspecting constraints and variable content before adding clipping or smaller hardcoded sizes.
- Prefer scrolling for content that legitimately exceeds available space.

## Preferred pattern

```dart
Padding(
  padding: const EdgeInsets.all(16),
  child: Column(
    crossAxisAlignment: CrossAxisAlignment.stretch,
    children: [
      const Header(),
      const SizedBox(height: 16),
      Expanded(
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            const Flexible(flex: 2, child: PrimaryContent()),
            const SizedBox(width: 16),
            const Flexible(child: SecondaryContent()),
          ],
        ),
      ),
      const SizedBox(height: 16),
      const Actions(),
    ],
  ),
)
```

Change this composition at a breakpoint if the horizontal content cannot remain usable on a narrow screen; do not merely squeeze it.

## Visual references

Inspect these diagrams when decomposing a mockup into nested flex layouts:

- [Pavlova Row and Column layout](assets/flutter-row-column-pavlova-layout_by_docs.flutter.dev.png) shows the overall horizontal `Row` containing a vertical content `Column` and an image.
- [Nested Row and Column diagram](assets/flutter-nested-row-column-diagram_by_docs.flutter.dev.png) shows smaller rating and icon groups decomposed into nested `Row` and `Column` widgets.

Use the diagrams as structural references, not as fixed pixel templates.

## Verification

- Confirm no RenderFlex overflow at supported viewport sizes.
- Confirm text wraps or truncates intentionally.
- Confirm flexible children receive bounded constraints.
- Confirm scrollable content remains reachable.
- Confirm fixed sizes and `Stack` or `Positioned` usages have a concrete design reason.

## Sources

- [Flutter layout guide](https://docs.flutter.dev/ui/layout#lay-out-multiple-widgets-vertically-and-horizontally)
- [Column API](https://api.flutter.dev/flutter/widgets/Column-class.html)
- [Expanded API](https://api.flutter.dev/flutter/widgets/Expanded-class.html)
- [Flexible.flex API](https://api.flutter.dev/flutter/widgets/Flexible/flex.html)

© Ivanna Kaceviča · MIT · evanca/flutter-ai-rules

Similar skills

All skills for Mobile →

From the same set39

The whole set →
firebase-cloud-functions Guides your coding agent on calling Firebase Cloud Functions in Flutter with error handling, region configs, and local emulator support. CX Codex +1 ★ 674repo stars testing The testing skill guides Flutter and Dart test writing and review, helps investigate flaky tests, and clarifies when to use unit or widget tests. CX Codex +1 ★ 674repo stars firebase-ai This skill gives the agent working patterns for wiring up Firebase AI Logic in a Flutter app and writing Gemini text and chat calls. CX Codex +1 ★ 674repo stars flutterfire-configure Guides Firebase integration in Flutter apps, runs flutterfire configure, and structures multi-flavor project environments. CX Codex +1 ★ 674repo stars firebase-crashlytics Skill teaches the agent to set up Firebase Crashlytics in Flutter projects: catch fatal and non-fatal errors, log async exceptions, add custom keys, and upload obfuscated build symbols. CX Codex +1 ★ 674repo stars firebase-in-app-messaging Guides Firebase In-App Messaging setup in Flutter: trigger and suppress popups during sensitive flows, configure GDPR opt-in collection, and run tests via test device IDs. CX Codex +1 ★ 674repo stars firebase-analytics firebase-analytics is a Claude Code skill for configuring Firebase Analytics in Flutter apps. It activates for event logging, user properties, funnels, and screen-view tracking. CX Codex +1 ★ 674repo stars patrol-e2e-testing patrol-e2e-testing is a skill for building and running Patrol 4.x end-to-end tests for Flutter apps, covering user flows, OS permission dialogs and cross-platform checks. CX Codex +1 ★ 674repo stars

Project sponsors

Companies that keep this analytics open