Flutter Performance Audit
Read-only. Change nothing in this phase.
Step 1: Map the app
Record, from the actual code (never assume):
- State management (e.g. Riverpod, Bloc) and where derived state lives
- Repository/service layer and networking; does the backend already paginate or aggregate?
- Widget hierarchy of performance-sensitive screens
- Existing pagination, image strategy, performance utilities
analysis_options.yaml lints (is prefer_const_constructors enabled?) and existing tests
Detection signals and how each architecture changes the recommended fix: references/architecture-adaptation.md. State the detected architecture in the plan and phrase every change in its terms.
Step 2: Find hotspots
Prioritise: long lists and feeds, dashboards with totals or aggregates, charts, search and filtering, rule-based processing, data import (CSV/JSON), analytics screens, image-heavy screens.
Search patterns (adapt to project):
- Heavy work in
build(): .where(, .sort(, .fold(, .reduce(, groupBy, jsonDecode, NumberFormat(, DateFormat( inside build
- Eager lists:
ListView(children: with .map( over a dataset; Column of mapped items inside SingleChildScrollView
- Broad subscriptions:
ref.watch(xProvider) where only one field is read; top-level Consumer
- Images:
Image.asset/Image.network in lists without cacheWidth/cacheHeight
- Effects:
Opacity, BackdropFilter, ClipRRect, ClipPath, saveLayer, large BoxShadow
Step 3: Classify
Every finding gets exactly one label:
| Label |
Meaning |
| confirmed issue |
Evidence in code or profile shows real cost |
| likely, needs measurement |
Plausible; profile before changing |
| acceptable |
Present but harmless; leave alone |
| optional future |
Real but low value or high risk now |
Step 4: Write the plan
One block per confirmed finding (and per likely finding only after measurement):
<plan>
<finding>items_screen.dart:88 sorts 5k items inside build()</finding>
<change>move sort into a provider keyed on the item list</change>
<reason>recomputed on every unrelated rebuild</reason>
<validation>unit test on ordering; DevTools build time before/after</validation>
</plan>
Do not plan checklist items that are not present in the code.
Hard rules
- Act only on what the user asked. Before answering or changing anything, open the relevant files and check what is already done; report only what you checked, never guess, and do not redo finished work. Reason: guesses and repeated work waste the user's credit.
Next
Route each planned change via flutter-performance-specialist. Baseline measurements: flutter-perf-profiling-and-validation.
1---2name: flutter-perf-audit3description: >4 Use when starting any Flutter performance task, before editing code, or when5 asked "where are the performance problems". Runs the investigation and6 planning phase of a Flutter performance review: maps architecture, state7 management, data flow, pagination, image strategy and lint rules, finds8 hotspots, classifies every finding, and writes the XML plan block. Do not use9 to implement fixes; hand off to the matching flutter-perf-* skill.10metadata:11 source: https://skillmd.com/skills/kinwisenz-devops/flutter-perf-audit12---1314# Flutter Performance Audit1516Read-only. Change nothing in this phase.1718## Step 1: Map the app1920Record, from the actual code (never assume):2122- State management (e.g. Riverpod, Bloc) and where derived state lives23- Repository/service layer and networking; does the backend already paginate or aggregate?24- Widget hierarchy of performance-sensitive screens25- Existing pagination, image strategy, performance utilities26- `analysis_options.yaml` lints (is `prefer_const_constructors` enabled?) and existing tests2728Detection signals and how each architecture changes the recommended fix: [references/architecture-adaptation.md](references/architecture-adaptation.md). State the detected architecture in the plan and phrase every change in its terms.2930## Step 2: Find hotspots3132Prioritise: long lists and feeds, dashboards with totals or aggregates, charts, search and filtering, rule-based processing, data import (CSV/JSON), analytics screens, image-heavy screens.3334Search patterns (adapt to project):3536- Heavy work in `build()`: `.where(`, `.sort(`, `.fold(`, `.reduce(`, `groupBy`, `jsonDecode`, `NumberFormat(`, `DateFormat(` inside build37- Eager lists: `ListView(children:` with `.map(` over a dataset; `Column` of mapped items inside `SingleChildScrollView`38- Broad subscriptions: `ref.watch(xProvider)` where only one field is read; top-level `Consumer`39- Images: `Image.asset`/`Image.network` in lists without `cacheWidth`/`cacheHeight`40- Effects: `Opacity`, `BackdropFilter`, `ClipRRect`, `ClipPath`, `saveLayer`, large `BoxShadow`4142## Step 3: Classify4344Every finding gets exactly one label:4546| Label | Meaning |47|---|---|48| confirmed issue | Evidence in code or profile shows real cost |49| likely, needs measurement | Plausible; profile before changing |50| acceptable | Present but harmless; leave alone |51| optional future | Real but low value or high risk now |5253## Step 4: Write the plan5455One block per confirmed finding (and per likely finding only after measurement):5657```xml58<plan>59 <finding>items_screen.dart:88 sorts 5k items inside build()</finding>60 <change>move sort into a provider keyed on the item list</change>61 <reason>recomputed on every unrelated rebuild</reason>62 <validation>unit test on ordering; DevTools build time before/after</validation>63</plan>64```6566Do not plan checklist items that are not present in the code.6768## Hard rules6970- Act only on what the user asked. Before answering or changing anything, open the relevant files and check what is already done; report only what you checked, never guess, and do not redo finished work. Reason: guesses and repeated work waste the user's credit.7172## Next7374Route each planned change via [flutter-performance-specialist](../flutter-performance-specialist/SKILL.md). Baseline measurements: [flutter-perf-profiling-and-validation](../flutter-perf-profiling-and-validation/SKILL.md).