Skip to content

app_debugger_network Pro

Alice-based HTTP inspector sub-brick for app_debugger. Adds a Network tab to the debugger panel. Supports Dio and http network libraries. Automatically swapped to a no-op stub in release builds via build_prepare.yaml.

Version: 1.0.0

Variables

VariableTypeDefaultDescription
networkLibraryenumdioWhich HTTP client library to inspect. Must match your network SDK choice. Values: dio, http

Prerequisites

  • app_debugger brick must be installed first.
  • Network SDK must be one of network_sdk_dio or network_sdk_http.

Usage

Interactive

bash
archipelago generate app_debugger_network

Non-interactive (CI)

bash
archipelago generate app_debugger_network --config my_config.json

When 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

1. Attach Alice's navigator key to MaterialApp

Without a navigator key the "Open Full Inspector" button silently no-ops.

dart
final alice = getIt<Alice>();

// For apps using go_router / auto_route:
MaterialApp.router(
  routerConfig: router,
  builder: alice.buildWithNavigatorObserver,
)

// For apps using a plain Navigator:
MaterialApp(
  navigatorKey: alice.getNavigatorKey(),
)

2. Attach the adapter to your network client

Dio

dart
import 'package:alice_dio/alice_dio_adapter.dart';

// In your Dio factory / register_module.dart:
dio.interceptors.add(getIt<AliceDioAdapter>());

http

dart
import 'package:alice_http/alice_http_adapter.dart';

final response = await http.get(uri);
getIt<AliceHttpAdapter>().onResponse(response);

How It Works

  1. NetworkInspectorSDKImpl registers a NetworkInspectorPage with DebuggerPanelPageRegistry on construction.
  2. DebuggerPanel reads DebuggerPanelPageRegistry.instance.pages and appends extra tabs — no import of app_debugger_network required.
  3. build_prepare.yaml swaps app_debugger_networkapp_debugger_network_noop for release builds, stripping all Alice code from the binary.
  4. The post-gen hook adds an eager GetIt.I<NetworkInspectorSDK>() call inside the archipelago:debug_panel_pages sentinel in bootstrap.dart.

Built by Banua Coder