π°οΈ flutter_lighthouse
Lighthouse for Flutter. Drop it in, tap once, and it auto-walks every route,
scores your app's performance 0β100 (Chrome-Lighthouse-style), and emits
actionable findings β "17 widgets rebuild on /feed", "hero.jpg decoded
16Γ larger than displayed" β each with a fix and a code example.

Why
DevTools is great for manual profiling. flutter_lighthouse is for the other
90% of the time β a one-tap, repeatable audit you can run on every build, paste
into a PR, or wire into CI. The scoring math is ported directly from Chrome
Lighthouse's log-normal curves (see SCORING_SPEC.md), so a
score means the same thing run to run.
Features
- One-call audit β
Lighthouse.audit(context)or a floating dev button. - Auto-walk β visits named routes, dwells, scrolls, collects.
- Real metrics β frame build/raster timing, jank ratio, FPS, route load latency, memory delta, oversized-image detection, widget rebuild storms.
- Chrome-grade scoring β 0β100 overall + Performance / Responsiveness / Memory / Best-Practices sub-scores, per route.
- Actionable findings β severity-ranked, each with a recommendation and a code example. Conservative thresholds keep false positives low.
- Exports β JSON (CI), Markdown (PR), HTML (shareable). Plus an in-app report screen with animated score gauges.
Getting started
dependencies:
flutter_lighthouse: ^0.1.0
Usage
One-tap overlay (dev builds)
import 'package:flutter_lighthouse/flutter_lighthouse.dart';
void main() {
runApp(
LighthouseOverlay(
config: LighthouseConfig(routes: ['/feed', '/profile', '/settings']),
child: const MyApp(),
),
);
}
Tap the ποΈ speed button β it walks your routes β a report screen opens.
Programmatic / headless
final report = await Lighthouse.audit(
context,
config: LighthouseConfig(routes: ['/feed', '/profile']),
);
print('Score: ${report.overallScore.round()} (${report.grade})');
for (final f in report.findings) {
print('${f.severity.label}: ${f.title} β ${f.recommendation}');
}
// Paste into a PR:
print(ReportExporter(report).toMarkdown());
Accurate rebuild counts
Flutter has no global rebuild hook, so wrap the subtrees you care about:
LighthouseProbe(label: 'FeedItem', child: FeedItem(post));
During an audit, every rebuild of that subtree is counted β no guessing, near- zero false positives.
Score thresholds
| Range | Grade | Meaning |
|---|---|---|
| 90β100 | Excellent | Ship it. |
| 70β89 | OK | Some findings worth addressing. |
| 50β69 | Needs work | Real perf debt. |
| 0β49 | Poor | Users feel this. |
vs. the alternatives
| flutter_lighthouse | DevTools | manual timeline | |
|---|---|---|---|
| One-tap repeatable audit | β | β | β |
| 0β100 score | β | β | β |
| Actionable findings + fixes | β | partial | β |
| PR / CI export | β | β | β |
| In-app, no desktop needed | β | β | β |
Roadmap
v0.2: network + bundle-size collectors, headless CI runner, GitHub Action, fail-on-regression threshold, dwell-weighted overall score.
Contributing
Issues and PRs welcome at github.com/jayu1023/flutter_lighthouse.
License
MIT Β© Jay Limbani
Libraries
- flutter_lighthouse
- Lighthouse for Flutter β audit any app's performance with one call.