flutter-errors — скилл для Claude Code: ошибки Flutter
flutter-errors — скилл для Claude Code, который помогает разбирать ошибки компоновки и выполнения Flutter. Он подключается при переполнении RenderFlex, проблемах с прокруткой и вызове setState во время сборки.
MIT ★ 674 обновлён 2026-10-29
/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rulesЧто делает flutter-errors
Скилл разбирает распространённые ошибки Flutter и предлагает правки для дерева виджетов. Среди случаев — переполнение Row или Column, неограниченная высота ListView, отсутствие размеров у RenderBox и вызов setState внутри build. Для исправления могут понадобиться Expanded, Flexible, SizedBox или отдельный ScrollController для каждой прокручиваемой области.
Скилл также объясняет, как отложить изменение состояния через addPostFrameCallback. Для проверки ограничений он предлагает Flutter Inspector в DevTools и временную отрисовку границ через debugPaintSizeEnabled в main().
Какие задачи решает
- исправить переполнение Row или Column
- ограничить высоту ListView внутри Column
- найти причину ошибки RenderBox was not laid out
- устранить вызов setState во время build
- разделить ScrollController между прокручиваемыми виджетами
Примеры запросов агенту
- Разбери ошибку RenderFlex overflow в этом экране и предложи правку.
- Почему ListView внутри Column получает неограниченную высоту? Исправь компоновку.
- Найди, где вызывается setState во время build, и перенеси изменение состояния.
Как установить flutter-errors
1Через маркетплейс плагинов
/plugin marketplace add evanca/flutter-ai-rules/plugin install flutter-ai-skills@flutter-ai-rulesКоманда ставит плагин flutter-ai-skills целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill flutter-errors -a claude-code3Вручную: положить файлы
~/.claude/skills/flutter-errors/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/flutter-errors/
1Через Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill flutter-errors -a codex2Вручную: положить файлы
.agents/skills/flutter-errors/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill flutter-errors -a cursor2Вручную: положить файлы
.cursor/skills/flutter-errors/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install evanca/flutter-ai-rules skills/flutter-errors2Вручную: положить файлы
.github/skills/flutter-errors/SKILL.md1Через Skills CLI (Vercel)
npx skills add evanca/flutter-ai-rules --skill flutter-errors -a gemini-cli2Командой платформы
gemini skills install https://github.com/evanca/flutter-ai-rules --path skills/flutter-errorsВручную: положить файлы
.devin/skills/flutter-errors/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о flutter-errors
Как установить flutter-errors в Claude Code?
Добавьте маркетплейс командой /plugin marketplace add evanca/flutter-ai-rules, затем установите скилл командой /plugin install flutter-ai-skills@flutter-ai-rules.
Что делает flutter-errors?
Скилл помогает устранять типичные ошибки компоновки и выполнения Flutter, включая переполнение, проблемы с ограничениями и вызов setState во время сборки.
Как исправить ошибку ScrollController attached to multiple scroll views?
Создайте отдельный экземпляр ScrollController для каждого прокручиваемого виджета.
Исходный текст
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