Feature SDKs (Pro)
app_debugger_network Pro
- Tier
- Proversion 1.2.4
- Command
archipelago generate app_debugger_network- Generates
features/app_debugger_network/app_debugger_networkfeatures/app_debugger_network/app_debugger_network_apifeatures/app_debugger_network/app_debugger_network_noop
- Generates first
- test_prereq, network_sdk, app_debuggerwhen needed and missing, so there is nothing to install first
- Depends on
- shared_identifiersgenerate these first
Alice-based HTTP inspector sub-brick for
app_debugger. Adds a Network tool to the debugger. Supports Dio and http network libraries. Automatically swapped to a no-op stub in production-flavor builds viabuild_prepare.yaml.
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| networkLibrary | enum | dio | Which HTTP client library to inspect. Must match your network SDK choice. Values: dio, http |
Prerequisites
app_debuggeris generated first when the project lacks it.- Network SDK must be one of
network_sdk_dioornetwork_sdk_http.pre_gengeneratesnetwork_sdkfirst wheninfrastructure/network_sdk_apiis missing and stops if it predatesNetworkInterceptorRegistry(network_sdk 2.4.0).
Usage
Interactive
archipelago generate app_debugger_networkNon-interactive (CI)
archipelago generate app_debugger_network --config my_config.jsonWhen archipelago.yaml is present, networkLibrary is auto-detected from infrastructure.network_library.
Generated Structure
features/
└── app_debugger_network/
├── app_debugger_network_api/
│ └── lib/src/
│ └── models/
├── app_debugger_network/
│ └── lib/src/
│ └── di/
└── app_debugger_network_noop/
└── lib/src/
└── di/Required Setup
Alice's navigator key is wired automatically — NetworkInspectorSDKImpl.initialize() attaches DebugOverlayHost.instance.navigatorKey (the same shared debug Navigator app_debugger's panel uses), so "Open Full Inspector", the system notification tap, and device-shake all work out of the box. No MaterialApp wiring needed.
The adapter attaches itself
NetworkInspectorSDKImpl offers Alice's adapter to network_sdk_api's NetworkInterceptorRegistry. DioHttpClient (Dio) adopts it as an interceptor and DartHttpClient (http) adopts AliceHttpAdapter.onResponse as a response observer, whichever is built first. No hand edit is needed, and a client built with DioHttpClient.init / DartHttpClient is covered. A client you construct yourself from plain Dio() or http.Client() is not.
Production builds register nothing: build_prepare swaps in the noop twin, which never touches the registry.
API
abstract interface class NetworkInspectorSDK implements FeatureSDK {
bool get isActive;
/// Dio: `AliceDioAdapter`. http: `AliceHttpAdapter`. noop: `null`.
Object? get adapter;
void showInspector();
}How It Works
NetworkInspectorSDKImplregisters aNetworkInspectorPagewithDebuggerPanelPageRegistryon construction.- The debugger home reads
DebuggerPanelPageRegistry.instance.pagesand lists each page as a tool on its own route — no import ofapp_debugger_networkrequired. build_prepare.yamlswapsapp_debugger_network→app_debugger_network_noopfor production-flavor builds, stripping all Alice code from the binary.NetworkInspectorSDKImpl.initialize()(run automatically by the pre-launchFeatureSDKsweep) attachesDebugOverlayHost.instance.navigatorKeyto Alice — the same shared Navigatorapp_debugger's own panel pushes onto, so Alice needs noNavigator/ModalRouteof its own and inherits that host's back-button and accessibility mitigations for free.
DI and wiring notes
post_gen.dart patches app_debugger's own features/app_debugger/app_debugger/lib/src/di/debug_tools.dart, inserting an eager GetIt.I<NetworkInspectorSDK>() call inside the two-segment // archipelago:debug_panel_pages:start/:end sentinel that app_debugger's own template ships. This moved off bootstrap.dart in 1.1.7 to match where all debug_panel_pages wiring now lives; that is the target on a current project. The marker moved between app_debugger versions, so the hook uses the first file that has it: app_debugger's lib/src/di/debug_tools.dart (2.0.0 and later), its lib/src/app_debugger_sdk_impl.dart (1.3.0 to 1.15.x), then the app's lib/bootstrap.dart (older), and adds the imports and path dependencies to that package. A file that already resolves the SDK is left as it is. If no file has the marker, pre_gen prints the lines to add and stops before it writes any file.
app_debugger_network/pubspec.yaml also declares:
archipelago:
di_modules:
- class: AppDebuggerNetworkPackageModuleso monorepo_toolkit generate host-registry can rediscover the module later. The noop counterpart (app_debugger_network_noop) is hand-written directly in injector.dart with the same AppDebuggerNetworkPackageModule class name (no codegen, no committed injector.module.dart) — a mismatch here used to be a landmine build_prepare's import-only rewrite couldn't fix (fixed in 1.1.9).
Testing
Alice() initializes flutter_local_notifications and asks for notification permission in its constructor, and NetworkInspectorSDKImpl resolves Alice while initializeInjector() runs. Under flutter test no platform answers, so the package ships AppDebuggerNetworkTestPrerequisite in package:app_debugger_network/testing.dart and declares it under archipelago: test_prerequisites. monorepo_toolkit generate test-harness adds it to the app's composition-root harness (see Testing and test_prereq).
Dependencies
alice: ^1.0.0, plusalice_dio: ^1.0.0(whennetworkLibrary: dio) oralice_http: ^1.0.0(whennetworkLibrary: http)app_debugger_api(path dependency into the siblingapp_debuggerbrick's API package) — hard prerequisite, not self-generated;pre_gen.dart/post_gen.dartonly auto-detect the network library and patchapp_debugger's files, they don't invokeSubBrickGeneratorfeature_sdk,identifiers,router_registry,dependencies— shared packages
Known Limitations
networkLibrarymust match whatever network SDK (network_sdk_diovsnetwork_sdk_http) is actually installed — auto-detection readsarchipelago.yaml'sinfrastructure.network_librarybut falls back todioif that key is absent, which is wrong for anhttp-only project with no config file.- Only clients built by
DioHttpClient/DartHttpClientare inspected. A hand-builtDio()orhttp.Client()is not.
Changelog
Run archipelago brick info app_debugger_network to see the latest published version. Enterprise customers can read the full CHANGELOG.md in the brick source repository.