Agent skill
Flutter Performance
Optimization standards for rebuilds and memory.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/performance-hoangnguyen0403-agent-skills-standar-3
Metadata
Additional technical details for this skill
- labels
-
performance
- triggers
-
{ "files": [ "lib/presentation/**", "pubspec.yaml" ], "keywords": [ "const", "buildWhen", "ListView.builder", "Isolate", "RepaintBoundary" ] }
SKILL.md
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. - Keys: Provide
ValueKeyfor 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
buildmethods free of heavy work; move logic to BLoC/Application. - Image Resizing: Always set
maxWidth/maxHeightwhen loading images.
🚫 Anti-Patterns
- Large Rebuilds:
**No SetState at Root**: Use granular builders (BlocBuilder, Consumer). - Logic in Build:
**No Heavy Work in body**: Perform parsing/sorting in the Business Layer. - Missing Const:
**No Dynamic Leaf Widgets**: Use const where possible.
BlocBuilder<UserBloc, UserState>(
buildWhen: (p, c) => p.id != c.id,
builder: (context, state) => Text(state.name),
)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?