ShakeDioInterceptor class

Dio interceptor that pushes every request/response/error cycle into the shake_context rolling network buffer. The captured NetworkLog entries appear in the developer overlay's Network panel on shake.

Wire it up once at the Dio configuration site:

import 'package:shake_context/dio.dart';

final dio = Dio()..interceptors.add(ShakeDioInterceptor());

Headers and bodies are run through RedactionConfig before being stored. Pass a custom redaction to widen or tighten the policy for this interceptor only; otherwise it inherits the singleton policy on LogCapture.instance.redaction.

Constructors

ShakeDioInterceptor({bool captureRequestBody = true, bool captureResponseBody = true, bool captureHeaders = true, RedactionConfig? redaction})

Properties

captureHeaders bool
When false, no headers are captured at all (lighter, less debuggable).
final
captureRequestBody bool
When false, request bodies are omitted from the captured entry.
final
captureResponseBody bool
When false, response bodies are omitted from the captured entry.
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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError(DioException err, ErrorInterceptorHandler handler) → void
Called when an exception was occurred during the request.
onRequest(RequestOptions options, RequestInterceptorHandler handler) → void
Called when the request is about to be sent.
onResponse(Response response, ResponseInterceptorHandler handler) → void
Called when the response is about to be resolved.
toString() String
A string representation of this object.
inherited

Operators

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