focus_tree_inspector 0.1.0
focus_tree_inspector: ^0.1.0 copied to clipboard
DevTools extension and bridge for best-effort Flutter focus tree inspection.
Inspect focus trees #
focus_tree_inspector is a best-effort tool to inspect:
- the focus tree
- current focus manager state
- track primary focus
It is designed for debugging and development workflows, not for production runtime diagnostics guarantees.
How it works #
This package consists of two parts:
- a DevTools extension UI
- an app-side bridge that must be registered in the target Flutter app
The DevTools extension reads data through service extensions exposed by the bridge.
Register the bridge in your app #
Register the bridge as early as possible (typically in main() before runApp):
import 'package:flutter/material.dart';
import 'package:focus_tree_inspector/focus_tree_inspector.dart';
void main() {
FocusTreeInspector.instance.registerFocusTreeBridge();
runApp(const MyApp());
}
Once registered, open DevTools and use the extension to inspect focus tree data, focus manager state, and primary focus.
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
License #
This package is licensed under the MIT License. See LICENSE for details.
