dio_premium_inspector 0.0.1
dio_premium_inspector: ^0.0.1 copied to clipboard
A premium, zero-boilerplate Dio HTTP interceptor for Flutter. Provides a state-of-the-art UI, zero routing conflicts, and AOT tree-shaking for production.
Dio Premium Inspector π #
A state-of-the-art, developer-friendly Flutter package that acts as a robust HTTP network interceptor for the dio client. It safely captures all outgoing requests, incoming responses, and network errors, displaying them in a premium on-device UI.
Features #
- π Zero Boilerplate: Drop it into
dio.interceptorsand you're done. NonavigatorKeyrequired. - π¨ Premium UI: Beautiful syntax highlighting, lazy JSON rendering, and HTTP status color-coding.
- π‘οΈ Zero-Conflict Routing: Uses
MaterialApp.builderto inject a global overlay. Safely works withGoRouterandAutoRoute. - π Enterprise Data Masking: Automatically redacts sensitive fields (
password,token) before generating exports. - π 1-Click cURL Export: Instantly generate shell-ready cURL commands.
- πͺΆ AOT 0-Byte Footprint: Wrapped in
kDebugModeto ensure the package is entirely stripped from your release builds.
Getting started #
Add the package to your pubspec.yaml:
dependencies:
dio_premium_inspector: ^0.0.1
Usage #
import 'package:flutter/material.dart';
import 'package:dio/dio.dart';
import 'package:dio_premium_inspector/dio_premium_inspector.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
late final Dio dio;
late final DioPremiumInspector dioInspector;
@override
void initState() {
super.initState();
dio = Dio();
// 1. Initialize the inspector
dioInspector = DioPremiumInspector(
dio: dio,
showFloatingBubble: true, // Show the draggable bubble
maxLogs: 100,
);
// 2. Attach it to your Dio instance
dio.interceptors.add(dioInspector.interceptor);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
// 3. Inject the overlay via builder (Zero routing conflicts)
builder: dioInspector.builder(),
home: Scaffold(
appBar: AppBar(title: const Text('My App')),
),
);
}
}
Security #
If you export a network call as a cURL command, the inspector automatically replaces keys matching authorization, password, token, secret, cvv with ***REDACTED*** to prevent accidental credential leakage in bug reports.