πŸ” Netify

A lightweight, debug-only network inspector for Flutter apps using Dio HTTP client. Features a modern UI with draggable floating bubble, dark mode, and share as image. Built with clean architecture principles and zero impact on release builds.

pub package License: MIT

✨ Features

  • πŸ“‘ Network Inspection - Capture and inspect all HTTP requests/responses via Dio interceptor
  • 🫧 Floating Bubble - Draggable floating bubble with request count badge
  • πŸŒ™ Dark Mode - Toggle between light and dark themes
  • πŸ“ Request Grouping - Group requests by domain for better organization
  • ⭐ Favorites - Bookmark important requests for quick access
  • πŸ“Έ Share as Image - Export request details as shareable images
  • πŸ” Search & Filter - Filter by status, method, and search by URL
  • πŸ“€ Export Options - Copy as JSON/HAR or save to file
  • πŸ”„ cURL Generation - Generate cURL commands for any request
  • πŸ” Replay Requests - Re-send any captured request
  • 🌲 Tree-Shakable - Zero footprint in release builds
  • πŸ“Š Detailed Metrics - Request time, response size, duration with color-coded indicators
  • πŸͺΆ Lightweight - Native Android/iOS implementation, only 2 dependencies (Dio + screenshot)

πŸ“Έ Screenshots

Logs List Log Detail Dark Mode Share as Image
Logs List Log Detail Share Dark Mode

πŸ“¦ Installation

Add to your pubspec.yaml:

dependencies:
  netify: ^2.0.0
  dio: ^5.4.0 # Required peer dependency

Then run:

flutter pub get

πŸš€ Quick Start

import 'package:dio/dio.dart';
import 'package:netify/netify.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final dio = Dio();
  await Netify.init(dio: dio);

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: Netify.navigatorKey, // ← Add this line
      home: HomePage(),
    );
  }
}

That's it! πŸŽ‰ The floating bubble will appear automatically.

πŸ“– API Reference

Initialize

// Basic initialization
await Netify.init(dio: dio);

// With custom configuration
await Netify.init(
  dio: dio,
  enable: kDebugMode, // Only enable in debug mode
  config: const NetifyConfig(
    maxLogs: 1000,
    entryMode: NetifyEntryMode.bubble,
  ),
);

Access Logs

// Get logs stream
Stream<List<NetworkLog>> stream = Netify.logsStream;

// Get current logs
List<NetworkLog> logs = Netify.logs;

// Get log count
int count = Netify.logCount;

Search & Filter

// Search logs by URL, method, or status
List<NetworkLog> results = Netify.searchLogs('api/users');

Export Logs

// Export as JSON
String json = Netify.exportAsJson();

// Export as HAR format (for Chrome DevTools, Postman, etc.)
String har = Netify.exportAsHar();

Generate cURL

// Generate cURL command for a request
String curl = Netify.generateCurl(log);

Clear Logs

// Clear all logs
Netify.clearLogs();

Dispose

// Dispose resources
await Netify.dispose();

πŸ“± UI Components

NetifyPanel

The main UI for viewing all captured network requests:

Navigator.push(
  context,
  MaterialPageRoute(builder: (_) => const NetifyPanel()),
);

LogDetailPage

Detailed view of a single request (automatically opened from NetifyPanel):

Navigator.push(
  context,
  MaterialPageRoute(builder: (_) => LogDetailPage(log: networkLog)),
);

βš™οΈ Configuration Options

Option Type Default Description
maxLogs int 500 Maximum number of logs to keep in memory
showOnlyInDebug bool true Only initialize in debug mode
entryMode NetifyEntryMode NetifyEntryMode.bubble Entry point mode (bubble or none)

πŸ—οΈ Architecture

Netify follows Clean Architecture principles:

lib/
β”œβ”€β”€ netify.dart              # Public API
└── src/
    β”œβ”€β”€ core/                # Domain layer (pure Dart)
    β”‚   β”œβ”€β”€ entities/        # Domain models
    β”‚   └── repositories/    # Abstract contracts
    β”œβ”€β”€ data/                # Data layer
    β”‚   β”œβ”€β”€ interceptor/     # Dio interceptor
    β”‚   β”œβ”€β”€ repositories/    # Concrete implementations
    β”‚   └── services/        # External services
    └── presentation/        # Presentation layer
        β”œβ”€β”€ pages/           # UI screens
        β”œβ”€β”€ widgets/         # Reusable widgets
        └── theme/           # Design tokens

πŸ”’ Privacy & Security

  • All data is stored in-memory only - nothing persists to disk
  • Automatically disabled in release builds (when showOnlyInDebug: true)
  • No data is sent to external servers
  • Logs are cleared when the app is closed

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Libraries

netify
Netify - A lightweight, debug-only network inspector for Flutter apps.