flutter-errors — Claude Code skill: Flutter errors
flutter-errors is a Claude Code skill that helps diagnose Flutter layout and runtime errors. It activates for RenderFlex overflow, scroll issues, and setState calls during build.
MIT ★ 674 updated 2026-10-29
/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rulesWhat flutter-errors does
The skill explains common Flutter failures and suggests changes to the widget tree. It covers Row or Column overflow, a ListView with unbounded height, an unlaid-out RenderBox, and setState called inside build. Suggested fixes include Expanded, Flexible, SizedBox, or a separate ScrollController for each scrollable widget.
It also shows how to defer state changes with addPostFrameCallback. To inspect constraints, it points to Flutter Inspector in DevTools and temporary boundary painting with debugPaintSizeEnabled in main().
What it helps with
- fix overflow in a Row or Column
- give a ListView inside Column a height constraint
- trace a RenderBox was not laid out error
- move setState calls out of build
- avoid sharing one ScrollController across scroll views
Example prompts for the agent
- Explain this RenderFlex overflow and suggest a widget-tree fix.
- Why does this ListView inside Column have unbounded height? Fix the layout.
- Find the setState call made during build and move the state change.
How to install flutter-errors
1Plugin marketplace
/plugin marketplace add evanca/flutter-ai-rules/plugin install flutter-ai-skills@flutter-ai-rulesThis installs the whole flutter-ai-skills plugin with all its skills
2Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill flutter-errors -a claude-code3Manually: put the files in place
~/.claude/skills/flutter-errors/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/flutter-errors/
1Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill flutter-errors -a codex2Manually: put the files in place
.agents/skills/flutter-errors/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill flutter-errors -a cursor2Manually: put the files in place
.cursor/skills/flutter-errors/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install evanca/flutter-ai-rules skills/flutter-errors2Manually: put the files in place
.github/skills/flutter-errors/SKILL.md1Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill flutter-errors -a gemini-cli2Platform CLI
gemini skills install https://github.com/evanca/flutter-ai-rules --path skills/flutter-errorsManually: put the files in place
.devin/skills/flutter-errors/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about flutter-errors
How do I install flutter-errors 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-errors do?
It helps diagnose common Flutter layout and runtime failures, including overflow, constraint problems, and state changes during build.
How do I fix a ScrollController attached to multiple scroll views?
Give each scrollable widget its own ScrollController instance.
Source text
SKILL.md · MIT
---
name: flutter-errors
description: "Use when hitting layout errors (RenderFlex overflow, unbounded constraints, RenderBox not laid out), scroll errors, or setState-during-build errors."
license: MIT
---
# 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` method.
**Fix:** Trigger state changes in response to user actions, or defer to after the frame using `addPostFrameCallback`:
```dart
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
// Safe to call setState or showDialog here
});
}
```
---
## ScrollController Attached to Multiple Scroll Views
**Error:** `The ScrollController is attached to multiple scroll views.`
**Cause:** A single `ScrollController` instance is shared across more than one scrollable widget simultaneously.
**Fix:** Ensure each scrollable widget has its own dedicated `ScrollController` instance.
---
## RenderBox Was Not Laid Out
**Error:** `RenderBox was not laid out: ...`
**Cause:** A widget is missing or has unbounded constraints — commonly `ListView` or `Column` without proper size constraints.
**Fix:** Review your widget tree for missing constraints. Common patterns:
- Wrap `ListView` in `Expanded` inside a `Column`.
- Give widgets an explicit `width` or `height` via `SizedBox` or `ConstrainedBox`.
---
## Debugging Layout Issues
- Use the **Flutter Inspector** (in DevTools) to visualize widget constraints.
- Enable **"Show guidelines"** to see layout boundaries.
- Add `debugPaintSizeEnabled = true;` temporarily in your `main()` to paint layout bounds.
- Refer to the [Flutter constraints documentation](https://docs.flutter.dev/ui/layout/constraints) for a deeper understanding of how constraints propagate.
## References
- [Flutter Website GitHub Repository](https://github.com/flutter/website)
© Ivanna Kaceviča · MIT · evanca/flutter-ai-rules