flutter-errors

Featured

Use when hitting layout errors (RenderFlex overflow, unbounded constraints, RenderBox not laid out), scroll errors, or setState-during-build errors.

AI & Automation 619 stars 60 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
93
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Flutter Errors Skill This skill provides solutions for the most common Flutter runtime and layout errors. --- ## RenderFlex Overflowed **Error:** `A RenderFlex overflowed by X pixels on the right/bottom.` **Cause:** A `Row` or `Column` contains children that are wider/taller than the available space. **Fix:** Wrap the overflowing child in `Flexible` or `Expanded`, or constrain its size: ```dart Row( children: [ Expanded(child: Text('Long text that might overflow')), Icon(Icons.info), ], ) ``` --- ## Vertical Viewport Given Unbounded Height **Error:** `Vertical viewport was given unbounded height.` **Cause:** A `ListView` (or other scrollable) is placed inside a `Column` without a bounded height. **Fix:** Wrap the `ListView` in `Expanded` or give it a fixed height with `SizedBox`: ```dart Column( children: [ Text('Header'), Expanded( child: ListView(children: [...]), ), ], ) ``` --- ## InputDecorator Cannot Have Unbounded Width **Error:** `An InputDecorator...cannot have an unbounded width.` **Cause:** A `TextField` or similar widget is placed in a context without width constraints. **Fix:** Wrap it in `Expanded`, `SizedBox`, or any parent that provides width constraints: ```dart Row( children: [ Expanded(child: TextField()), ], ) ``` --- ## setState Called During Build **Error:** `setState() or markNeedsBuild() called during build.` **Cause:** `setState` or `showDialog` is called directly inside the `build` me...

Details

Author
evanca
Repository
evanca/flutter-ai-rules
Created
1 years ago
Last Updated
today
Language
Shell
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category