carp_debug_flutter library

An in-app debugging toolkit for CARP Flutter apps.

Wrap the app's root widget in CarpDebugToolkit to get a draggable floating button that opens a self-contained debug menu. The menu is independent of the host app's widget tree, so it keeps working even when a screen crashes.

Included tools:

  • switch the deployment server and override any launch argument (--dart-define) at runtime — see DebugEnv and EnvEntry;
  • inspect, edit and delete shared-preferences / user-session data — see KeyValueStore;
  • browse and delete records in the local (sembast) database — see DebugDatabase;
  • view device / app metadata and captured logs & errors.

Register your own screens by implementing DebugTool and passing them via DebugToolkitConfig.extraTools.

Classes

CarpDebugToolkit
Wraps the host application and overlays the debug toolkit on top of it.
DebugController
Holds the live state of the debug toolkit: whether the menu is open, the resolved list of tools, the floating-button position and shared services.
DebugDatabase
An inspectable, structured database surfaced by the "Database" tool.
DebugEnv
Runtime override layer for compile-time launch arguments (--dart-define).
DebugLog
An in-memory ring buffer that captures debugPrint output, framework errors and uncaught async errors so they can be reviewed in the "Logs" tool — even after a screen has crashed.
DebugLogEntry
A single captured log line.
DebugRecord
A single record (key + value) read from a DebugDatabase store.
DebugScaffold
A consistent Scaffold for tool pages pushed onto the toolkit navigator.
DebugTool
A single entry in the debug menu.
DebugToolkitConfig
Immutable configuration describing what the debug toolkit can do for a particular app.
EnvEntry
Declarative description of a single overridable launch argument (a --dart-define value) that the app normally reads via String.fromEnvironment.
KeyValueStore
A generic, inspectable key/value store surfaced by the "Preferences" tool.
NativeBridge
Thin, failure-tolerant Dart wrapper around the Pigeon-generated CarpDebugHostApi.
NativeDeviceInfo
Read-only snapshot of device and application metadata, collected natively.
SembastDebugDatabase
A DebugDatabase backed by a sembast Database.
SembastStoreDescriptor
Couples a human-readable label with a sembast StoreRef so the toolkit can inspect it. The app provides these because sembast does not enumerate its stores at runtime.
SharedPreferencesKeyValueStore
A KeyValueStore backed by a SharedPreferences instance.

Enums

DebugLogLevel
Severity of a captured DebugLogEntry.
EnvValueType
The kind of value a launch argument holds. Drives which editor widget the Environment tool renders.