Tracelet Doctor

πŸ“š Official Documentation: tracelet.ikolvi.com

Copy AI Setup Prompt

⚑ Set up Tracelet with AI. Click the badge to copy a ready-made prompt, then paste it into your AI coding assistant (Cursor, Claude Code, Kiro, Copilot Chat…) β€” it interviews you, then installs and configures Tracelet (and wires up this diagnostic overlay as a debug-only dev dependency) in your Flutter app.

License Pub Package tracelet Pub

Drop-in diagnostic overlay for Tracelet β€” visualize permissions, OEM health, battery state, sensors, and tracking status in a single tap.

Screenshot

The Doctor shows a premium dark-themed bottom sheet with:

  • ⚠️ Warnings β€” actionable issues (permission denied, power save, aggressive OEM, mock GPS, etc.)
  • πŸ›‘οΈ Permissions β€” location, motion activity, accuracy authorization
  • πŸ“ Tracking State β€” enabled/disabled, mode, motion, odometer, scheduler
  • πŸ”‹ Battery & OEM β€” power save, battery optimization, manufacturer, aggression rating meter
  • πŸ“‘ Sensors β€” accelerometer, gyroscope, magnetometer, significant-motion
  • πŸ’Ύ Database & Device β€” pending location count, mock detection, platform, OS version

Quick Start

Tracelet Doctor is a debugging tool, so add it under dev_dependencies β€” Flutter excludes dev-dependency packages from release builds, keeping it out of what you ship:

dependencies:
  tracelet: ^2.0.6

dev_dependencies:
  tracelet_doctor: ^1.0.1

Because it lives in dev_dependencies, guard every reference to it behind kDebugMode so the import is tree-shaken out of release builds and your app still compiles in release mode:

import 'package:flutter/foundation.dart' show kDebugMode;
import 'package:tracelet_doctor/tracelet_doctor.dart';

// Show the diagnostic sheet β€” debug builds only.
if (kDebugMode) {
  TraceletDoctor.show(context);
}

A common pattern is a debug-only trigger, so it never appears in production:

Scaffold(
  // ...
  floatingActionButton: kDebugMode
      ? FloatingActionButton(
          onPressed: () => TraceletDoctor.show(context),
          child: const Icon(Icons.medical_services),
        )
      : null,
);

That's it β€” one line to show it, and it's automatically stripped from release builds.

Why dev_dependencies? In release mode Flutter drops dev-dependency packages, and the kDebugMode guards let the Dart tree-shaker remove the Doctor code and its import entirely β€” so it adds nothing to your production app size and can't be opened by end users. If you instead need the diagnostics available in a production support build, move tracelet_doctor to regular dependencies and drop the kDebugMode guards.

Features

  • Zero native code β€” pure Dart/Flutter widget
  • One-line integration β€” TraceletDoctor.show(context)
  • Dark glassmorphic theme β€” premium aesthetic with semantic status colors
  • 12 warning types β€” automatically computed from device state
  • Copy to clipboard β€” export the full diagnostic JSON for sharing
  • Re-run β€” refresh diagnostics without dismissing the sheet
  • Loading state β€” animated pulse indicator while gathering data
  • Error handling β€” graceful retry on platform call failures

How It Works

The Doctor calls Tracelet.getHealth() internally, which fires 10 parallel platform calls:

  1. getState() β€” tracking enabled, mode, motion, odometer
  2. getProviderState() β€” location services, GPS, network, accuracy
  3. getSettingsHealth() β€” OEM manufacturer, aggression rating
  4. getSensors() β€” accelerometer, gyroscope, magnetometer, sig-motion
  5. getDeviceInfo() β€” platform, OS version
  6. isPowerSaveMode() β€” battery saver active
  7. isIgnoringBatteryOptimizations() β€” app exemption status
  8. getPermissionStatus() β€” location authorization
  9. getMotionPermissionStatus() β€” motion/activity recognition
  10. getCount() β€” pending locations in the database

All results are aggregated into a typed HealthCheck object with automatically computed warnings.

Architecture

This is a separate, optional package in the Tracelet monorepo:

Package Description
tracelet Core SDK β€” the only package apps depend on (pub.dev)
tracelet_doctor (this package) Diagnostic overlay widget
tracelet_platform_interface Abstract platform interface
tracelet_android Kotlin Android implementation
tracelet_ios Swift iOS implementation
tracelet_web Web implementation

License

Apache 2.0 β€” see LICENSE for details.

Libraries

tracelet_doctor
Drop-in diagnostic overlay widget for Tracelet.