dio_premium_inspector 0.0.1 copy "dio_premium_inspector: ^0.0.1" to clipboard
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.interceptors and you're done. No navigatorKey required.
  • 🎨 Premium UI: Beautiful syntax highlighting, lazy JSON rendering, and HTTP status color-coding.
  • πŸ›‘οΈ Zero-Conflict Routing: Uses MaterialApp.builder to inject a global overlay. Safely works with GoRouter and AutoRoute.
  • πŸ” 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 kDebugMode to 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.

0
likes
160
points
32
downloads

Documentation

API reference

Publisher

verified publishercodewithshamil.com

Weekly Downloads

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.

Repository (GitHub)

Topics

#dio #network #inspector #logging #debugging

License

MIT (license)

Dependencies

dio, flutter

More

Packages that depend on dio_premium_inspector