Skip to content

Install & Configure

  1. Add the dependency

    Add it under dev_dependencies so it is excluded from production archives (see Production Builds):

    pubspec.yaml
    dev_dependencies:
    carp_debug_flutter: ^0.1.0

    The built-in Shared Preferences and Database tools depend on shared_preferences and sembast. If your app already uses them (every CARP app does), no extra setup is needed.

    Terminal window
    flutter pub get
  2. Platform configuration

    Minimum deployment target iOS 15.0. The plugin supports both Swift Package Manager and CocoaPods but SPM is recommended.

  3. Wrap your app

    Continue to the Quickstart to wrap your app’s root widget in CarpDebugToolkit.

It is recommended that the toolkit be excluded from the release archive. As a dev_dependency, reference it only from kDebugMode-gated code so it is both disabled at runtime and excluded from the release archive. The full pattern (app-local hook, debug-only setup file, per-platform exclusion details) is on the Production Builds page.

import 'package:flutter/foundation.dart';
// Folds to `runApp(app)` in release; the wrapper (and the package) is
// tree-shaken away.
runApp(kDebugMode ? debug.wrapWithDebugToolkit(app) : app);

CarpDebugToolkit also accepts an enabled flag (defaults to true) for cases where the package stays in the build but you want a runtime switch.

When enabled is false, CarpDebugToolkit returns its child untouched with zero overhead.