DebugKitDioAdapter class

A DebugKitAdapter that integrates Dio network observability.

Pass an instance to DebugKit.init to automatically log all Dio HTTP transactions — requests, responses, and errors — into the DebugKit console:

final dio = Dio();

DebugKit.init(
  enabled: true,
  adapters: [DebugKitDioAdapter(dio)],
);

Alternatively, add the interceptor directly to an existing Dio instance:

dio.interceptors.add(DebugKitDioInterceptor(DebugKit.controller));

What is logged:

  • HTTP method and sanitized URL (sensitive query parameters masked).
  • Response status code and round-trip duration.
  • Sanitized request and response headers.
  • Error type and message on failure.
  • 'cancelled' status for Dio cancel exceptions.

What is NOT logged:

  • Request bodies — never captured to prevent PII leakage.
  • Response bodies — never captured by default.
  • Binary or multipart payloads — always ignored.

Trace correlation: requests made inside an active DebugKit.trace.run zone automatically carry DebugLogEntry.traceId and a corresponding DebugTraceEventType.network event is recorded on the active trace.

Constructors

DebugKitDioAdapter(Dio dio)
Creates a DebugKitDioAdapter for the given dio instance.

Properties

dio → Dio
The Dio instance whose network traffic will be logged.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

attach(DebugKitController controller) → void
Attaches a DebugKitDioInterceptor to dio.
dispose() → void
Removes the DebugKitDioInterceptor from dio and releases resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited