DevTools
Connect and protect diagnostic data
Install the extension, connect it to a VM service, and reveal only explicitly safe application values.
Connect and protect diagnostic data
Add the development package
dev_dependencies:
usecase_forge_devtools: ^0.1.0-dev.3
Resolve dependencies, start the Dart or Flutter application in a non-product mode with a VM service, open DevTools for that service, and select UseCase Forge. No application initialize() call is required.
Product and release builds do not expose this channel. The extension is a development observer, not a production monitoring agent.
Read the execution screen
The overview identifies live UseCases, registered exact command types, current lifecycle position, terminal history, rejections, cancellation, and error routing. It cannot add commands, cancel executions, change state, replay work, or modify policies.
Keep application values hidden by default
Technical lifecycle metadata is available automatically. State contents, command fields, keys, error objects, stack traces, and rejection details stay hidden unless the application formats selected values.
import 'package:usecase_forge/diagnostics.dart';
final class CartUseCase extends UseCase<CartState>
with UseCaseDiagnosticsDataProvider {
@override
String get useCaseDiagnosticLabel => 'Shopping cart';
@override
Object? encodeUseCaseDiagnosticValue(
UseCaseDiagnosticValueKind kind,
Object? value,
) {
if (kind == UseCaseDiagnosticValueKind.state && value is CartState) {
return <String, Object?>{'itemCount': value.itemCount};
}
return null;
}
}
Return only JSON-safe, bounded information that is safe to show. Returning null keeps a value hidden. Never expose credentials, tokens, personal data, complete payloads, or unrestricted toString() output.
If the screen is empty
- Confirm the package is a direct development dependency of the inspected application.
- Restart both the application and DevTools after resolving dependencies.
- Connect DevTools to the active VM service; opening the compiled
index.htmldirectly is unsupported. - Use a non-product build and create at least one live UseCase.
- Check that core and DevTools protocol versions are compatible.