Creative & DesignIntermediate
flutter-building-layouts
Build and fix layouts using the constraint system (Row, Column, Stack)
Developer Setup
Setup & Installation
bash
npx skills add https://github.com/flutter/skills --skill flutter-building-layoutsnpx skills add https://github.com/flutter/skills --skill flutter-building-layoutsOr paste this URL into your assistant to install:
Overview
What This Skill Does
Build and fix layouts using the constraint system (Row, Column, Stack)
Application
When to use this Skill
- Integrating flutter building layouts into your development workflow.
- Following best practices for build and fix layouts using the constraint system (row, column, stack).
- Automating repetitive tasks with AI-assisted tooling.
- Building production-grade applications with proper standards.
- Debugging and troubleshooting common implementation issues.
Documentation
Show Skills.md file
Architecting Flutter Layouts
Contents
- Core Layout Principles
- Structural Widgets
- Adaptive and Responsive Design
- Workflow: Implementing a Complex Layout
- Examples
Core Layout Principles
Master the fundamental Flutter layout rule: Constraints go down. Sizes go up. Parent sets position.
- Pass Constraints Down: Always pass constraints (minimum/maximum width and height) from the parent Widget to its children. A Widget cannot choose its own size independently of its parent's constraints.
- Pass Sizes Up: Calculate the child Widget's desired size within the given constraints and pass this size back up to the parent.
- Set Position via Parent: Define the
xandycoordinates of a child Widget exclusively within the parent Widget. Children do not know their own position on the screen. - Avoid Unbounded Constraints: Never pass unbounded constraints (e.g.,
double.infinity) in the cross-axis of a flex box (RoworColumn) or within scrollable regions (ListView). This causes render exceptions.
Structural Widgets
Select the appropriate structural Widget based on the required spatial arrangement.
- Use
RowandColumn: ImplementRowfor horizontal linear layouts andColumnfor vertical linear layouts. Control child alignment usingmainAxisAlignmentandcrossAxisAlignment. - Use
ExpandedandFlexible: Wrap children ofRoworColumninExpandedto force them to fill available space, orFlexibleto allow them to size themselves up to the available space. - Use
Container: Wrap Widgets in aContainerwhen you need to apply padding, margins, borders, or background colors.
Lines 1 - 25 of 120
Recommendations
Explore other random skills
OfficeIntermediate
knowledge-capture
Transform conversations into structured Notion documentation pages with proper organization and linking
OfficeIntermediate
meeting-intelligence
Prepare meeting materials by gathering Notion context and creating pre-reads and agendas
OfficeBeginner
research-documentation
Search Notion workspace, synthesize findings, and create comprehensive research reports