Skillshub flutter-performance
Optimization standards for rebuilds and memory. Use when optimizing Flutter widget rebuilds, reducing memory usage, or improving rendering performance. (triggers: lib/presentation/**, pubspec.yaml, const, buildWhen, ListView.builder, Isolate, RepaintBoundary)
install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/HoangNguyen0403/agent-skills-standard/flutter-performance" ~/.claude/skills/comeonoliver-skillshub-flutter-performance && rm -rf "$T"
manifest:
skills/HoangNguyen0403/agent-skills-standard/flutter-performance/SKILL.mdsource content
Performance
Priority: P1 (OPERATIONAL)
Performance optimization techniques for smooth 60fps Flutter applications.
- Rebuilds: Use
widgets andconst
/buildWhen
for granular updates.select - Lists: Always use
for item recycling.ListView.builder - Heavy Tasks: Use
orcompute()
for parsing/logic.Isolates - Repaints: Use
for complex animations. UseRepaintBoundary
to debug.debugRepaintRainbowEnabled - Images: Use
+CachedNetworkImage
.memCacheWidth
for SVGs.precachePicture - Keys: Provide
for list items and stable IDs for reconciliation.ValueKey - Resource Cleanup: Dispose controllers/streams in
.dispose() - Pagination: Default to 20 items per page for network lists.
- Build Purity: Keep
methods free of heavy work; move logic to BLoC/Application.build - Image Resizing: Always set
/maxWidth
when loading images.maxHeight
Anti-Patterns
- ❌
at the root/page level to update a single counter — usesetState()
withBlocBuilder
orbuildWhen
for granular rebuildscontext.select() - ❌ Sorting/filtering a list inside
— move heavy computation to BLoC or usebuild()compute() - ❌ Non-
leaf widgets that never change — always applyconst
to static widgets to skip reconciliationconst - ❌
for large lists — useColumn(children: items.map((e) => ItemWidget(e)).toList())
for item recyclingListView.builder
BlocBuilder<UserBloc, UserState>( buildWhen: (p, c) => p.id != c.id, builder: (context, state) => Text(state.name), )