flutter-performancelisted
Install: claude install-skill abugeek/flutter-skills
# Flutter performance
Verified 2026-09-25 against docs.flutter.dev/perf (Flutter 3.47: Impeller is the default renderer on iOS, Android API 29+, macOS, Windows and Linux; not web).
A frame has **~16 ms at 60 Hz (~8 ms at 120 Hz)**. Almost every real Flutter performance problem is self-inflicted: too-wide rebuilds, work in `build()`, eager lists, full-resolution images, or CPU work on the UI isolate. The engine (Impeller) is rarely the bottleneck.
## Measure first
- Profile in **profile mode on a real (ideally low-end) device**. Debug-mode numbers are meaningless.
- Use DevTools Performance and the Timeline (frame times, jank), the Performance Overlay, and Memory (leaks, image cache).
- Optimize when you see dropped frames, stuttering animations, or laggy scrolling. Otherwise write clear code first. No premature optimization.
## Rebuilds
- Call `setState` as low in the tree as possible. State high up rebuilds everything below it.
- Split big widgets into **small widget classes** (not helper methods, which rebuild with the parent). Use `const` constructors wherever possible; const widgets are skipped on rebuild.
- Nothing expensive in `build()` (parsing, sorting, filtering, formatting big data). Do it in `initState`/`didUpdateWidget` (recompute only when input changed) or in the state layer.
- In Riverpod/BLoC, watch only what the widget needs (`select`, `BlocSelector`, `context.select`) so unrelated state changes don't rebuild it.
- Flutter Web is extra sensitive to deep