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

On-device performance and stability tracer for Flutter. Frame timing, startup, error capture, and main-thread stall detection in debug/profile; complete no-op in release.

example/README.md

flutter_perf_radar example #

A minimal Flutter wiring that shows every entry point used in a real app.

Setup in main() #

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await PerfRadar.init(PerfRadarConfig.standard());
  runApp(
    PerfRadar.overlay(child: const MyApp()),
  );
}

Instrumenting a route #

class ProductsScreen extends StatelessWidget {
  const ProductsScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Products')),
      body: TracedSubtree(
        label: 'products_list',
        child: const _ProductList(),
      ),
    );
  }
}

Tracing async operations #

Future<List<Product>> loadProducts() async {
  return PerfRadar.traceAsync('load_products', () async {
    return await productsRepository.fetchAll();
  });
}

Manual start/stop for callback-bounded code #

void startDecoding(Uint8List bytes) {
  final handle = PerfRadar.start('image_decode', category: 'media');
  decoder.decode(
    bytes,
    onDone: (_) => handle.stop(),
    onError: (e) => handle.fail(e),
  );
}

Reading frame stats and stability #

final frames = PerfRadar.frameStats;
print('frames: ${frames.frameCount}  jank: ${frames.jankCount}');

final stability = PerfRadar.stabilitySnapshot;
print('errors: ${stability.errorCount}  stalls: ${stability.stallCount}');

Opening the full inspector #

Navigator.of(context).push(
  MaterialPageRoute(builder: (_) => const PerfRadarScreen()),
);
0
likes
160
points
153
downloads

Documentation

API reference

Publisher

verified publishertp9imka.dev

Weekly Downloads

On-device performance and stability tracer for Flutter. Frame timing, startup, error capture, and main-thread stall detection in debug/profile; complete no-op in release.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#performance #tracing #observability #debugging #flutter

License

MIT (license)

Dependencies

flutter, meta, radar_trace, radar_ui

More

Packages that depend on flutter_perf_radar