radarscope 0.1.3 copy "radarscope: ^0.1.3" to clipboard
radarscope: ^0.1.3 copied to clipboard

All-in-one umbrella for the Radar observability suite — one import and one init for Flutter memory, performance, and stability, with an overlay badge and a unified inspector.

radarscope #

pub.dev License: MIT

Umbrella package for the Radar observability suite. One import, one Radar.init call, one unified overlay badge and dashboard — composes flutter_leak_radar and flutter_perf_radar without duplicating any domain logic.


Installation #

dependencies:
  radarscope: ^0.1.0

This single dependency pulls in flutter_leak_radar, flutter_perf_radar, and radar_trace.


Quick start #

import 'package:radarscope/radarscope.dart';

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

That's it. Both the memory leak detector and the performance/stability tracer are active in debug/profile builds and are complete no-ops in release.

Wire the navigator observer #

MaterialApp(
  navigatorObservers: [Radar.navigatorObserver],
  home: ...,
)

Usage #

Tracing operations #

// Synchronous.
final result = Radar.trace('parse_config', () => parseConfig(raw));

// Async.
final user = await Radar.traceAsync('fetch_user', () => api.getUser(id));

// Manual start/stop.
final handle = Radar.start('image_decode');
decoder.decode(bytes, onDone: () => handle.stop());

Tracking object lifetimes (leak detection) #

class MyController {
  MyController() {
    Radar.track(this, tag: 'MyController');
  }

  void dispose() {
    Radar.markDisposed(this);
    // ... release resources
  }
}

Opening the unified inspector #

Navigator.of(context).push(
  MaterialPageRoute(builder: (_) => const RadarScreen()),
);

RadarScreen shows three tabs — Leaks (powered by LeakRadarView), Performance (PerfRadarView, frame/jank timing), and Stability (StabilityView, error and main-thread-stall capture) — in a single dark-theme scaffold. Performance and Stability are both driven by the flutter_perf_radar runtime, so the three domains ride on just two engines.

Custom configuration #

await Radar.init(RadarConfig(
  leak: LeakRadarConfig.standard(
    autoScan: AutoScan(onNavigation: true, period: Duration(minutes: 2)),
    showOverlay: true,
  ),
  perf: PerfRadarConfig(
    enabled: kDebugMode || kProfileMode,
    showOverlay: true,
    stallThresholdMicros: 100000,
  ),
));

Features #

  • One-import storyimport 'package:radarscope/radarscope.dart' re-exports all public symbols from flutter_leak_radar, flutter_perf_radar, and the radar_trace types needed by Radar.start() consumers.
  • Single Radar.init call — initialises both engines in parallel via Future.wait.
  • Unified overlayRadar.overlay(child: ...) renders one draggable badge combining leak, performance, and stability signals. Badge colour reflects the worst signal: green (clean), amber (warning leaks, jank, or stalls), red (critical leaks or errors).
  • RadarScreen — three-tab (Leaks, Performance, Stability) unified dashboard. No extra wiring needed.
  • RadarConfig.standard() — opinionated defaults for both domains; override either independently via named arguments.
  • Zero-throw contractRadar delegates to each domain facade and never throws into the host app.
  • Complete no-op in release — all calls are safe to leave in production code. No build flavours or conditional guards required.

Package Purpose
flutter_leak_radar On-device memory leak detector — heap growth, precise retention, overlay.
flutter_perf_radar Performance and stability tracer — frame timing, jank, rebuild counting, plus error capture and main-thread stall detection.
radar_trace Pure-Dart tracer engine — spans, histograms, Zone nesting.
flutter_leak_radar_lint Static analysis: undisposed controllers, uncancelled subscriptions.

License #

MIT — see LICENSE.

0
likes
160
points
236
downloads

Documentation

API reference

Publisher

verified publishertp9imka.dev

Weekly Downloads

All-in-one umbrella for the Radar observability suite — one import and one init for Flutter memory, performance, and stability, with an overlay badge and a unified inspector.

Homepage
Repository (GitHub)
View/report issues

Topics

#memory #performance #observability #debugging #flutter

License

MIT (license)

Dependencies

flutter, flutter_leak_radar, flutter_perf_radar, radar_trace, radar_ui, share_plus

More

Packages that depend on radarscope