| name | Flutter Performance |
|---|---|
| description | Optimization standards for rebuilds and memory. |
| metadata | {"labels": ["performance"], "triggers": {"files": ["lib/presentation/**", "pubspec.yaml"], "keywords": ["const", "buildWhen", "ListView.builder", "Isolate", "RepaintBoundary"]}} |
Performance
Priority: P1 (OPERATIONAL)
Performance optimization techniques for smooth 60fps Flutter applications.
- Rebuilds: Use
constwidgets andbuildWhen/selectfor granular updates. - Lists: Always use
ListView.builderfor item recycling. - Heavy Tasks: Use
compute()orIsolatesfor parsing/logic. - Repaints: Use
RepaintBoundaryfor complex animations. UsedebugRepaintRainbowEnabledto debug. - Images: Use
CachedNetworkImage+memCacheWidth.precachePicturefor SVGs.
BlocBuilder<UserBloc, UserState>(
buildWhen: (p, c) => p.id != c.id,
builder: (context, state) => Text(state.name),
)