waste_lens 0.1.1 copy "waste_lens: ^0.1.1" to clipboard
waste_lens: ^0.1.1 copied to clipboard

Live in-app detector for wasted Flutter work — dead rebuilds, redundant API calls, memory leaks, and memory pressure. Debug/profile only, a no-op in release.

example/example.dart

import 'package:flutter/material.dart';
import 'package:waste_lens/waste_lens.dart';

/// Minimal `waste_lens` setup: wrap your app once. The diagnostics overlay
/// appears in debug/profile; in release this is a zero-overhead no-op.
///
/// The full "Evidence Ledger" demo — one screen per module, each committing a
/// deliberate offence the overlay catches live — lives in the repository's
/// top-level `example/` directory.
void main() {
  runApp(
    const WasteLens(
      config: WasteLensConfig(
        memory: true,
        leaks: true,
        rebuilds: true,
        overlay: true,
      ),
      child: _DemoApp(),
    ),
  );
}

class _DemoApp extends StatelessWidget {
  const _DemoApp();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('waste_lens')),
        body: Center(
          // A dead rebuild caught red-handed: the probe proves the price never
          // changes even when an ancestor rebuilds.
          child: DeadRebuildProbe(
            label: 'PriceTag',
            fingerprint: () => const [42.0, 'USD'],
            child: const Text(r'$42.00'),
          ),
        ),
      ),
    );
  }
}
5
likes
160
points
250
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Live in-app detector for wasted Flutter work — dead rebuilds, redundant API calls, memory leaks, and memory pressure. Debug/profile only, a no-op in release.

Repository (GitHub)
View/report issues
Contributing

Topics

#performance #profiling #debugging #memory

License

MIT (license)

Dependencies

collection, flutter, leak_tracker, meta, vm_service

More

Packages that depend on waste_lens