flutter-performance · git:20261122.26135a7 · 2026-11-22 · sha256 74f9b3cd1002c266
flutter-performance git:20261122.26135a7A
Immutable. This exact content never changes and is served at /api/v1/blob/74f9b3cd1002c266.
No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_xpxabf7acg37ofvi/74f9b3cd1002c26683090a4c8d0957ab8d989e89e336506659c95f79b66ed39c.json
Then /plugin install flutter-performance@markdownregistry-xpxabf7acg37ofvi in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.
---
name: flutter-performance
description: Optimize Flutter widget rebuilds, memory usage, rendering, and scrolling performance. Use when diagnosing jank, reducing rebuilds, or improving list performance—not performance tests, monitoring setup, or API optimization.
metadata:
triggers:
files:
- 'lib/presentation/**'
- 'pubspec.yaml'
- 'ListView.builder'
keywords:
- const
- buildWhen
- Isolate
- RepaintBoundary
---
# Performance
## **Priority: P1 (HIGH)**
- **Rebuilds**: Use `const` widgets and `buildWhen` / `select` for granular updates.
- **Lists**: Always use `ListView.builder` for item recycling.
- **Heavy Tasks**: Use `compute()` or `Isolates` for parsing/logic.
- **Repaints**: Use `RepaintBoundary` for complex animations. Use `debugRepaintRainbowEnabled` to debug.
- **Images**: Use `CachedNetworkImage` + `memCacheWidth`. `precachePicture` for SVGs.
- **Keys**: Provide `ValueKey` for list items and stable IDs for reconciliation.
- **Resource Cleanup**: Dispose controllers/streams in `dispose()`.
- **Pagination**: Default to 20 items per page for network lists.
- **Build Purity**: Keep `build` methods free of heavy work; move logic to BLoC/Application.
- **Image Resizing**: Always set `maxWidth`/`maxHeight` when loading images.
## Anti-Patterns
- **No Root `setState()`**: Use `BlocBuilder` with `buildWhen` or `context.select()` for granular updates
- **No Heavy Business in `build()`**: Move sorting/filtering/heavy logic to BLoC or `compute()`
- **No Non-`const` Leaf Nodes**: Apply `const` to all static widgets to skip unnecessary reconciliation
- **No Large `Column` Lists**: Use `ListView.builder` for efficient item recycling in large lists
```dart
BlocBuilder<UserBloc, UserState>(
buildWhen: (p, c) => p.id != c.id,
builder: (context, state) => Text(state.name),
)
```