# Flutter Expert

> Flutter/Dart gotchas and decision criteria. Covers Riverpod vs BLoC, widget optimization, and platform-specific pitfalls. Use when this capability is needed.

- Skill: `tomevault-io/flutter-expert-8` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/flutter-expert-8`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/flutter-expert-8/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/flutter-expert-8

---


> **AI-consumed reference.** Optimized for Claude to read during execution.
> Human-readable explanation: see [docs/architecture/HIERARCHICAL_PLANNING.md](../../../docs/architecture/HIERARCHICAL_PLANNING.md)
> or [docs/getting-started/](../../../docs/getting-started/) depending on topic.


# Flutter Expert — Gotchas & Decisions

Use Context7 for full Flutter/Dart docs.

## Key Decisions

```toon
decisions[4]{choice,use_when}:
  Riverpod vs BLoC,"Riverpod: simpler apps + compile-safe. BLoC: complex event-driven + team conventions"
  StatelessWidget vs StatefulWidget,"Stateless default. Stateful only for local mutable state (animations/controllers)"
  go_router vs Navigator,"go_router for declarative deep linking. Navigator for simple stack-based"
  Feature-first vs Layer-first,"Feature-first: lib/features/auth/{data|domain|presentation}"
```

## Gotchas

- Always `const` constructors for immutable widgets — huge rebuild savings
- `BuildContext` used after async gap → widget may be unmounted. Check `mounted` first
- `ListView.builder` not `ListView(children:[...])` for long lists — avoids building all items
- `sealed class` for Result pattern (Success/Failure) — exhaustive switch
- Riverpod: `ref.watch` in build, `ref.read` in callbacks. Never `ref.watch` in callbacks
- BLoC: never emit state after `close()` — check `isClosed` in async operations
- Platform channels: always handle `MissingPluginException` for web/desktop
- `TextEditingController` and `AnimationController` MUST be disposed in `dispose()`
- `MediaQuery.of(context)` causes rebuilds — use `MediaQuery.sizeOf(context)` for just size

---
> Source: [nguyenthienthanh/aura-frog](https://github.com/nguyenthienthanh/aura-frog) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-26 -->

