debug_terminal 1.0.0
debug_terminal: ^1.0.0 copied to clipboard
A robust, hidden, and secure debugging terminal for Flutter. Features a secret long-press trigger, PIN-gate protection, and specialized API/Error logging.
debug_terminal ๐ก๏ธ #
debug_terminal is a high-performance, stealthy, and secure debugging toolkit for Flutter applications.
Designed for teams that need to inspect API traffic and system logs in production-like environments, it provides a "hidden door" into your app's internals without compromising the user experience or security for regular users.
โจ The USP: Why debug_terminal? #
Most logging tools are either stripped out for production or left dangerously exposed. debug_terminal is built differently:
- ๐ Zero-Friction Development: By setting
requirePinForShortcut: false, you get instant access via the floating button or quad-tap during development. No PIN entry required when you just want to see your logs! - ๐ก๏ธ Secure Production Inspection: Unlike other tools, you don't have to remove this from your
releasebuilds. It remains stealthily active, protected by a hidden "Hold" gesture, tactile deterrents, and a secure PIN gate. - ๐ก Specialized Intelligence: Not just a text dumpโspecialized views for JSON payloads, API headers, and stack traces.
- ๐ ๏ธ One-Line Integration: Works with any app architecture (GetX, Bloc, Provider, etc.) with zero setup overhead.
๐ Activation Strategies #
Choose the method that best fits your workflow:
| Method | Description | Security |
|---|---|---|
| Long Press | Hold anywhere for 5s (configurable). | โ PIN Required |
| Combo Taps | Tap quickly N times (e.g., Quad-tap). | โ Configurable |
| Debug Button | A visible FAB (Debug mode ONLY). | ๐ Instant Access |
๐ฆ Installation #
Add this to your pubspec.yaml:
dependencies:
debug_terminal: ^1.0.0
๐ ๏ธ Quick Start (One-Step Setup) #
You can install and configure the terminal in exactly one step by wrapping your application root (usually in MaterialApp.builder):
import 'package:debug_terminal/debug_terminal.dart';
MaterialApp(
// ...
builder: (context, child) => DebugTerminal.wrap(
child!,
config: DebugTerminalConfig(
pin: 1234, // Access code
holdDuration: Duration(seconds: 3), // Secret hold time
openOnTapCount: 4, // Open on Quad-tap
showFloatingButton: true, // FAB (Debug only)
),
),
)
Tip
Best Practice: DebugTerminal.wrap() should ideally be called once at the very root of your application. This ensures consistent logging and a single unified debug overlay.
๐ Advanced Logging #
Inspecting API Traffic #
Perfect for Dio or Http interceptors:
DebugTerminal.logApi(
path: "/v1/orders",
method: "POST",
body: {"id": 101},
response: {"status": "shipped"},
code: 200,
);
Catching Exceptions #
Keep track of production crashes:
try {
throw "Payment Failed";
} catch (e, stack) {
DebugTerminal.logError("Checkout Error", error: e, stack: stack);
}
๐ก๏ธ Security Model #
- Release Safety: The floating button and detailed console are automatically gated (hidden) in release mode. Only discrete gestures remain active.
- Tactile Deterrents: During the "Hold" activation, the device vibrates with increasing intensity to discourage non-developers from continuing the hold.
โ Support the Project #
If you find debug_terminal helpful and want to support its continued development, you can buy me a coffee!
๐ License #
This project is licensed under the MIT License - see the LICENSE file for details.

