performance-patternslisted
Install: claude install-skill IuliaIvanaPatras/claude-code-templates
# Performance Patterns Skill
Best practices for Flutter performance with Impeller rendering, Riverpod 3.x, and DevTools profiling.
## When to Use
- User mentions "slow screen" / "jank" / "frame drops" / "optimize"
- Large APK/IPA size or slow startup
- Widget rebuild overhead or animation stuttering
- Questions about profiling, DevTools, or performance budgets
---
## Quick Reference: Common Problems
| Problem | Symptom | Solution |
|---------|---------|----------|
| Excessive rebuilds | Slow UI, high CPU in profile | `const`, `select()`, split widgets |
| Jank during scroll | Dropped frames, stuttering | `ListView.builder`, `itemExtent`, `RepaintBoundary` |
| Large images | Memory pressure, OOM crashes | `cached_network_image`, resize, `precacheImage` |
| Large APK size | >30 MB download, slow install | `--split-per-abi`, deferred imports, tree shaking |
| Slow startup | 3+ seconds cold start | Lazy init, deferred loading, reduce main() work |
| Animation jank | <60 FPS during transitions | Impeller, `RepaintBoundary`, simplify painters |
| Heavy computation | Frozen UI during processing | `Isolate.run()`, `compute()` |
| Memory leaks | Growing memory, eventual crash | Dispose controllers, cancel subscriptions |
---
## Widget Rebuild Optimization
### Const Constructors
```dart
// ❌ Rebuilds every frame — new instance each time
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.all(16), // new EdgeInsets each build
child: Col