flutter_dev_toolkit 1.3.0
flutter_dev_toolkit: ^1.3.0 copied to clipboard
A powerful, modular in-app developer console for Flutter apps. Includes logs, network inspector, route tracker, performance tools, and plugin system.
Flutter Dev Toolkit #
π A modular in-app developer console for Flutter apps.
Track logs, API calls, navigation, lifecycle events, screen transitions, app state, and more β all in real time, inside your app.
β¨ Features #
- β In-app Dev Console with floating overlay
- β Colored logs with filtering and tagging
- β
Network call inspector (supports
http
,dio
, andretrofit
) - β Route stack and screen duration tracker
- β Lifecycle event logging
- β Export logs, network calls, and route data
- β Plugin system for adding custom tools
- β App State Inspector (Bloc support)
π Installation #
Add to your pubspec.yaml
:
dependencies:
flutter_dev_toolkit: ^latest_version
Then:
flutter pub get
π Getting Started #
1. Initialize the toolkit #
void main() {
FlutterDevToolkit.init(
config: DevToolkitConfig(
logger: DefaultLogger(),
disableBuiltInPlugins: [
// BuiltInPluginType.logs,
// BuiltInPluginType.network,
// BuiltInPluginType.routes,
// BuiltInPluginType.deviceInfo,
],
),
);
runApp(MyApp());
}
2. Add Dev Console Overlay #
MaterialApp(
builder: (context, child) {
return Stack(
children: [
child!,
const DevOverlay(),
],
);
},
navigatorObservers: [RouteInterceptor.instance],
);
π Network Setup #
πΉ Using http
package #
Replace the default client with HttpInterceptor from the toolkit:
import 'package:http/http.dart' as http;
import 'package:flutter_dev_toolkit/flutter_dev_toolkit.dart';
final client = HttpInterceptor(); // Instead of http.Client()
final response = await client.get(Uri.parse('https://example.com'));
πΉ Using dio
#
Register Dio interceptor:
final dio = Dio();
dio.interceptors.add(DioNetworkInterceptor());
πΉ Using retrofit
#
Pass the configured Dio instance to your Retrofit client:
final api = MyApiClient(Dio()..interceptors.add(DioNetworkInterceptor()));
π§© Plugins #
You can add custom developer tools as plugins:
class CounterPlugin extends DevToolkitPlugin {
@override
String get name => 'Counter';
@override
IconData get icon => Icons.exposure_plus_1;
@override
void onInit() => debugPrint('CounterPlugin loaded!');
@override
Widget buildTab(BuildContext context) => Center(child: Text('Counter Tab'));
}
FlutterDevToolkit.registerPlugin(CounterPlugin());
π App State Inspector #
Inspect state transitions (Bloc only for now).
Bloc.observer = DevBlocObserver();
FlutterDevToolkit.registerPlugin(
AppStateInspectorPlugin([
BlocAdapter(),
]),
);
π Logging #
FlutterDevToolkit.logger.log('Message');
FlutterDevToolkit.logger.log('Error occurred', level: LogLevel.error);
π€ Exporting #
You can export relevant data directly from each pluginβs tab:
- Logs Plugin β Export filtered logs
- Network Plugin β Export captured network calls
- Route Tracker β Export route stack and navigation history
πΌοΈ Screenshots #
Log Console
[screenshots/logs.png]Bloc Inspector β Overview
[screenshots/bloc_inspector.png]Device Info
[screenshots/device_info.png]Network Interceptor
[screenshots/network_interceptor.png]Route Tracker
[screenshots/route.png]π License #
MIT