network_inspector 1.0.2 network_inspector: ^1.0.2 copied to clipboard
Http inspector / logger for Dio and Http package. This package would allow you to log every Http request, response, and error from Dio & Http.
import 'package:flutter/material.dart';
import 'package:network_inspector/network_inspector.dart';
import 'package:provider/provider.dart';
import 'common/navigation_service.dart';
import 'common/notification_helper.dart';
import 'presentation/controllers/main_provider.dart';
import 'presentation/pages/main_page.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
NetworkInspector.initialize();
NotificationHelper.initialize();
runApp(const ExampleApp());
}
class ExampleApp extends StatelessWidget {
const ExampleApp({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider<MainProvider>(
create: (context) => MainProvider(
context: context,
),
builder: (context, child) => MaterialApp(
title: 'Network inspector',
theme: ThemeData(
primarySwatch: Colors.blue,
),
navigatorKey: NavigationService.navigatorKey,
initialRoute: MainPage.routeName,
routes: NavigationService.routes,
),
);
}
}