Install & Configure
Add the dependency
Add it under
dev_dependenciesso it is excluded from production archives (see Production Builds):pubspec.yaml dev_dependencies:carp_debug_flutter: ^0.1.0pubspec.yaml dev_dependencies:carp_debug_flutter:git:url: https://github.com/cph-cachet/carp-debug-flutterpubspec.yaml dev_dependencies:carp_debug_flutter:path: ../carp_debug_flutterThe built-in Shared Preferences and Database tools depend on
shared_preferencesandsembast. If your app already uses them (every CARP app does), no extra setup is needed.Terminal window flutter pub getPlatform configuration
Minimum deployment target iOS 15.0. The plugin supports both Swift Package Manager and CocoaPods but SPM is recommended.
Minimum
minSdk 24, andcompileSdk 34+are required.Wrap your app
Continue to the Quickstart to wrap your app’s root widget in
CarpDebugToolkit.
Keeping it out of production
Section titled “Keeping it out of production”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.