interceptly 2.0.1
interceptly: ^2.0.1 copied to clipboard
Flutter network inspector for Dio, HTTP, and Chopper with overlay UI, replay tools, and HAR/cURL export.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:interceptly/interceptly.dart';
import 'src/example.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final server = ExampleLocalServer();
final baseUrl = await server.start();
final clients = ExampleClients.create(baseUrl: baseUrl);
final appNavigatorKey = GlobalKey<NavigatorState>();
runApp(
InterceptlyExampleApp(
clients: clients,
navigatorKey: appNavigatorKey,
server: server,
),
);
Interceptly.init(
navigatorKey: appNavigatorKey,
settings: InterceptlySettings(
maxBodyBytes: 50 * 1024 * 1024,
maxUiPreviewBytes: 50 * 1024 * 1024,
shouldCapture: (url) => !url.contains('/analytics'),
redactedHeaders: const {
'authorization',
'cookie',
'set-cookie',
'x-api-key',
'token',
},
),
);
}