wishtohear/bucket-water-oms/flutter-building-layouts
Claude Code and agent skill by wishtohear/bucket-water-oms
- community
Checking that the SKILL.md file is still in the repository.
Builds Flutter layouts using the constraint system and layout widgets. Use when creating or refining the UI structure of a Flutter application.
Install
npx vskill@latest install wishtohear/bucket-water-oms/flutter-building-layoutsSKILL.md
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 `Row` and `Column`: Implement
Rowfor horizontal linear layouts andColumnfor vertical linear layouts. Control child alignment usingmainAxisAlignmentandcrossAxisAlignment. - Use `Expanded` and `Flexible`: Wrap children of
RoworColumninExpandedto force them to fill available space, orFlexibleto allow them to size themselves up to the available space. - Use `Container`: Wrap Widgets in a
Containerwhen you need to apply padding, margins, borders, or background colors. - Use `Stack`: Implement
Stackwhen Widgets must overlap on the Z-axis. UsePositionedto anchor children to specific edges of theStack. - Use `SizedBox`: Enforce strict, tight constraints on a child Widget by wrapping it in a
SizedBoxwith explicitwidthandheightvalues.
Adaptive and Responsive Design
Apply conditional logic to handle varying screen sizes and form factors.
- If fitting UI into available space (Responsive): Use
LayoutBuilder,Expanded, andFlexibleto dynamically adjust the size and placement of elements based on the parent's constraints. - If adjusting UI usability for a specific form factor (Adaptive): Use conditional rendering to swap entire layout structures. For example, render a bottom navigation bar on mobile, but a side navigation rail on tablets/desktop.
Workflow: Implementing a Complex Layout
Follow this sequential workflow to architect and implement robust Flutter layouts.
Task Progress
- [ ] Phase 1: Visual Deconstruction
- [ ] Break down the target UI into a hierarchy of rows, columns, and grids.
- [ ] Identify overlapping elements (requiring
Stack). - [ ] Identify scrolling regions (requiring
ListVieworSingleChildScrollView). - [ ] Phase 2: Constraint Planning
- [ ] Determine which Widgets require tight constraints (fixed size) vs. loose constraints (flexible size).
- [ ] Identify potential unbounded constraint risks (e.g., a
ListViewinside aColumn). - [ ] Phase 3: Implementation
- [ ] Build the layout from the outside in, starting with the
Scaffoldand primary structural Widgets. - [ ] Extract deeply nested layout sections into separate, stateless Widgets to maintain readability.
- [ ] Phase 4: Validation and Feedback Loop
- [ ] Run the application on target devices/simulators.
- [ ] Run validator -> review errors -> fix: Open the Flutter Inspector. Enable "Debug Paint" to visualize render boxes.
- [ ] Check for yellow/black striped overflow warnings.
- [ ] If overflow occurs: Wrap the overflowing Widget in
Expanded(if inside a flex box) or wrap the parent in a scrollable Widget.
Examples
Example: Resolving Unbounded Constraints in Flex Boxes
Anti-pattern: Placing a ListView directly inside a Column causes an unbounded height exception because the Column provides infinite vertical space to the ListView.
Implementation: Wrap the ListView in an Expanded Widget to bound its height to the remaining space in the Column.
Example: Responsive Layout with LayoutBuilder
Implement LayoutBuilder to conditionally render different structural Widgets based on available width.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingbucket-water-oms-admin-mobile/skills/flutter-building-layouts/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wishtohear/bucket-water-oms/flutter-building-layouts)