-
Notifications
You must be signed in to change notification settings - Fork 3
Configuration
AmisKwok edited this page Jul 21, 2026
·
2 revisions
| Parameter | Type | Default | Description |
|---|---|---|---|
enable |
bool | true |
Enable inspector (auto false in release mode) / 启用检查器 |
enableLogCapture |
bool | true |
Enable log capture / 启用日志捕获 |
enableNetworkCapture |
bool | true |
Enable network interception / 启用网络拦截 |
enableDatabaseScan |
bool | true |
Enable database scan / 启用数据库扫描 |
enableRouteTracking |
bool | true |
Enable route tracking / 启用路由追踪 |
customButton |
Widget? | null |
Custom floating button widget / 自定义悬浮按钮 |
onLogCaptured |
void Function(LogEntry)? |
null |
Log capture callback for third-party integration / 日志捕获回调 |
ZeroInspectorKit.init(
enableLogCapture: true,
enableNetworkCapture: false, // Disable network monitoring / 禁用网络监控
enableDatabaseScan: true,
enableRouteTracking: false, // Disable route tracking / 禁用路由追踪
);ZeroInspectorKit.init(
onLogCaptured: (entry) {
// Forward to your logging service / 转发到你的日志服务
myLogger.log(entry.message);
},
);A convenience widget that automatically shows/hides the inspector based on build mode.
根据构建模式自动显示/隐藏检查器的便利组件。
ConditionalInspector(
child: YourAppWidget(),
)| Parameter | Type | Default | Description |
|---|---|---|---|
child |
Widget | required | Child widget / 子组件 |
enabled |
bool | true |
Enable inspector / 启用检查器 |
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled |
bool | true |
Enable button (auto false in release mode) / 启用按钮 |
| Method | Description |
|---|---|
start() |
Start capturing logs / 开始捕获日志 |
stop() |
Stop capturing logs / 停止捕获日志 |
log(level, message, tag) |
Add a log entry / 添加日志条目 |
verbose(message, tag) |
Add verbose log / 添加详细日志 |
debug(message, tag) |
Add debug log / 添加调试日志 |
info(message, tag) |
Add info log / 添加信息日志 |
warning(message, tag) |
Add warning log / 添加警告日志 |
error(message, tag) |
Add error log / 添加错误日志 |
| Property | Type | Description |
|---|---|---|
onLogCaptured |
void Function(LogEntry)? |
Callback when a log is captured / 日志捕获回调 |
Navigator observer for tracking route changes. Auto-injected when using runAppWithInspector() or wrapApp().
用于追踪路由变化的 Navigator 观察者。使用 runAppWithInspector() 或 wrapApp() 时自动注入。
MaterialApp(
navigatorObservers: [InspectorRouteObserver()],
home: MyHomePage(),
)Register custom database providers:
注册自定义数据库提供者:
DatabaseRegistry.instance.registerProvider(SqliteDatabaseProvider());See Custom Database Provider for more details.
详见 自定义数据库提供者。