Skip to main content
rule CX Codex

flutter_errors — Claude Code rule for Flutter errors and setup

This rule connects common Flutter errors to likely layout or state-management causes. Use it when a widget tree fails with overflow, sizing, or build-phase issues.

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_errors does

The rule maps Flutter error messages to checks in the widget tree. For RenderFlex overflowed, it points to unconstrained children in a Row or Column and suggests adding Flexible, Expanded, or explicit constraints. A scrollable widget inside a Column needs a height bound; a TextField may need its width constrained. It also warns against calling setState or showDialog directly from build.

Other cases include a ScrollController shared by multiple scroll views and RenderBox was not laid out. The guidance recommends inspecting widget constraints with Flutter Inspector. Calling setState during build is a direct trigger for one of the errors covered here.

What it helps with

  • trace overflow in a Row or Column
  • bound a ListView inside a Column
  • constrain a TextField width
  • move setState out of build
  • stop sharing one ScrollController across scroll views

Example prompts for the agent

  • Find the cause of RenderFlex overflowed in this Row and suggest a fix.
  • Explain why this ListView inside a Column has unbounded height.
  • Check this widget for a setState called during build error.

How to install flutter_errors

1Plugin marketplace

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

2Manually: put the files in place

.claude/rules/flutter_errors.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about flutter_errors

How do I install flutter_errors in Claude Code?

Run these commands in order: /plugin marketplace add evanca/flutter-ai-rules, then /plugin install flutter-ai-skills@flutter-ai-rules. The rule file path is .claude/rules/flutter_errors.md.

What does flutter_errors do?

It links common Flutter errors to likely causes involving layout constraints, scrolling, and state changes during the build phase.

How does it address an unbounded-height error?

For a ListView or similar scrollable inside a Column, the rule recommends giving it a height bound, such as with Expanded or SizedBox.

Source text

flutter_errors.md · MIT
### Common Flutter Errors

1. If you get a "RenderFlex overflowed" error, check if a `Row` or `Column` contains unconstrained widgets. Fix by wrapping children in `Flexible`, `Expanded`, or by setting constraints.
2. If you get "Vertical viewport was given unbounded height", ensure `ListView` or similar scrollable widgets inside a `Column` have a bounded height (e.g., wrap with `Expanded` or `SizedBox`).
3. If you get "An InputDecorator...cannot have an unbounded width", constrain the width of widgets like `TextField` using `Expanded`, `SizedBox`, or by placing them in a parent with width constraints.
4. If you get a "setState called during build" error, do not call `setState` or `showDialog` directly inside the build method. Trigger dialogs or state changes in response to user actions or after the build completes (e.g., using `addPostFrameCallback`).
5. If you get "The ScrollController is attached to multiple scroll views", make sure each `ScrollController` is only attached to a single scrollable widget at a time.
6. If you get a "RenderBox was not laid out" error, check for missing or unbounded constraints in your widget tree. This is often caused by using widgets like `ListView` or `Column` without proper size constraints.
7. Use the Flutter Inspector and review widget constraints to debug layout issues. Refer to the official documentation on constraints if needed.

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

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set39

The whole set →
code_review The code_review rule for Claude Code sets a review process for changes before merging. It checks branches, files, code, tests, and the PR/MR description. CX Codex +1 ★ 674repo stars 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. CX Codex +1 ★ 674repo stars mocktail Guidance for using Mocktail in Dart and Flutter tests: configure stubs, inspect interactions, and decide when a mock, fake, or real object fits. CX Codex +1 ★ 674repo stars flutter-change-notifier flutter-change-notifier — a skill that teaches the agent to use ChangeNotifier and provider for Flutter state management: models, providers, Consumer, rebuild optimization. CX Codex +1 ★ 674repo stars provider Guides agents on architecting Flutter state with the provider package, keeping rebuilds minimal and dependencies reactive. CX Codex +1 ★ 674repo stars mockito mockito is a Claude Code skill for Dart and Flutter tests that guides mock generation, stubbing, and interaction checks. It activates for Mockito testing tasks. CX Codex +1 ★ 674repo stars developing-genkit-dart developing-genkit-dart — a skill for building AI agents with Genkit Dart that tells the agent when to pull in reference docs for the core framework and its plugins. CX Codex +1 ★ 674repo stars firebase-storage firebase-storage is a skill with guidelines for Firebase Cloud Storage in Flutter apps, covering file uploads, downloads, metadata changes, and storage error handling. CX Codex +1 ★ 674repo stars

Project sponsors

Companies that keep this analytics open