ConsolePlus
Pub package: https://pub.dev/packages/console_plus
Repository: https://github.com/ashish8381/console_plus
A floating in-app console for Flutter β view, filter, search & export logs while your app runs!
console_plus lets you debug on-device with a floating overlay console that captures print() and debugPrint() in real time.
π Version 2.0.0 & 2.0.1 Highlights
π Major Rewrite for Stability & Zone Safety
- π§ Zone-safe initialization β no more βZone mismatchβ errors.
- πͺ Unified log capture β
print()+debugPrint()+ platform errors all logged automatically. - π§© Cleaner API β single
ConsolePlus.initApp()entry point. - π¨ Redesigned console UI β smoother, resizable, searchable overlay.
- π§ͺ Better Flutter Test compatibility β works seamlessly inside test zones.
β¨ Features
β
Floating draggable console overlay
β
Logs display above your appβs UI (non-blocking)
β
Captures print() and debugPrint()
β
Auto-scroll when near the bottom
β
Filter logs by type (INFO, WARNING, ERROR)
β
Keyword search for tags or text
β
Runtime toggle: high-performance (virtualized) vs full-text mode
β
Saved search queries per profile
β
Command palette (pause, clear, export templates, copy filtered logs)
β
Optional custom actions API for console extensions
β
Copy, clear, and export logs as JSON
β
Built-in floating π debug button
β
Captures FlutterError and PlatformDispatcher errors
β
Compatible with Flutter 3.16+ / Dart 3+
βοΈ Installation
Add to your pubspec.yaml:
dependencies:
console_plus: ^2.0.2
Then fetch packages:
flutter pub get
Import it:
import 'package:console_plus/console_plus.dart';
π» Usage
Step 1 β Initialize ConsolePlus
Wrap your app inside ConsolePlus.initApp():
Future<void> main() async {
await ConsolePlus.initApp(
const MyApp(),
interceptPrints: true, // Capture print() and debugPrint()
captureFlutterErrors: true, // Capture Flutter framework errors
capturePlatformErrors: true, // Capture platform dispatcher errors
);
}
π§ This ensures WidgetsFlutterBinding and runApp() are initialized in the same zone β no more zone mismatch errors!
Step 2 β Show Floating Debug Button
FloatingDebugButton.show(context);
This shows a draggable π button that opens the console overlay.
Step 3 β Log Messages
Use:
DebugLogConsole.log("User logged in successfully");
DebugLogConsole.log("Missing field: email", type: LogType.warning);
DebugLogConsole.log("API request failed", type: LogType.error);
Or just use:
print("Something happened");
debugPrint("App started!");
Both are automatically captured by ConsolePlus.
Switch rendering mode at runtime:
DebugLogConsole.highPerformanceMode = true; // virtualized, faster
DebugLogConsole.highPerformanceMode = false; // full selectable text block
Saved queries profile + custom actions:
await DebugLogConsole.setSavedQueryProfile('qa-staging');
DebugLogConsole.registerCustomAction(
ConsoleCustomAction(
id: 'quick-note',
label: 'Add Quick Note',
icon: Icons.note_add_outlined,
onExecute: (context, filteredLogs) async {
DebugLogConsole.addLog('Quick note | filtered: ${filteredLogs.length}');
},
),
);
Mode Selection Guide
| Expected Log Volume | Recommended Mode | Why |
|---|---|---|
< 500 logs/session |
Full-text |
Best for copy/select across one continuous block |
500 - 2000 logs/session |
High-performance |
Better frame stability while preserving per-line selection |
2000+ logs/session or burst logging |
High-performance |
Strongest protection against UI jank and input lag |
Step 4 β Export Logs
Tap the β¬οΈ Download icon in the console header to export as a .json file.
You can also programmatically call:
final json = await DebugLogConsole.exportLogs(asJson: true);
ποΈ Console UI
- π’ Floating, draggable, and resizable window
- π Search bar with keyword filtering
- π§© Filter by log levels (Info / Warning / Error)
- π Copy, β¬οΈ Export, ποΈ Clear logs
- π Persistent scroll + multi-line selection
- β‘ Real-time updates powered by ValueNotifier
π§© Example (Benchmark App)
import 'package:console_plus/console_plus.dart';
import 'package:flutter/material.dart';
Future<void> main() async {
await ConsolePlus.initApp(
const ConsolePlusExampleApp(),
interceptPrints: true,
captureFlutterErrors: true,
capturePlatformErrors: true,
);
}
class ConsolePlusExampleApp extends StatelessWidget {
const ConsolePlusExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ConsolePlus Benchmark',
theme: ThemeData.dark(useMaterial3: true),
home: const BenchmarkPage(),
);
}
}
The example app now includes:
- Runtime mode switch (
High Performance Mode) Run 1k BenchmarkandRun 5k Benchmarkbuttons- Live metrics: enqueue time, first UI update latency, settle time, estimated FPS
Open example/lib/main.dart for the full benchmark implementation.
π File Export
Format: .json
Example output:
[
{
"timestamp": "2025-11-08T12:30:01.345Z",
"type": "info",
"message": "App started"
},
{
"timestamp": "2025-11-08T12:31:14.123Z",
"type": "error",
"message": "Network timeout"
}
]
π§ Upgrading from v1.x β v2.0.1
Before:
void main() {
ConsolePlus.init(MyApp());
runApp(MyApp());
}
After (v2.0.0):
Future<void> main() async {
await ConsolePlus.initApp(
const MyApp(),
interceptPrints: true,
captureFlutterErrors: true,
capturePlatformErrors: true,
);
}
β ConsolePlus.init() β replaced with ConsolePlus.initApp() β Initialization now must be awaited β Zone-safe by default β fixes zone mismatch crashes β No more manual WidgetsFlutterBinding.ensureInitialized() calls required
Contributing
PRs welcome. Keep debug-only behaviour intact. If you add native platform code, ensure release builds keep plugin inert unless explicitly enabled.
π License
MIT License Β© 2025 Ashish
See the full LICENSE file for details.
π¬ Credits
Built with β€οΈ by Ashish Follow for updates and Flutter dev tips!