Flutter 3D Inspector
English | 简体中文
Flutter 3D Inspector is an open-source spatial layout inspector for Flutter DevTools. It complements the official Inspector by making overlapping widgets, dialogs, routes, and overlays easier to understand and select.
Installation
Add the package as a development dependency. No application import or runtime integration is required.
flutter pub add --dev flutter_3d_inspector
Start a Flutter application in debug mode and open DevTools. Enable
flutter_3d_inspector from the Extensions dialog, then open its tab.
Features
- Reads the real layout tree through Flutter Inspector VM Service APIs.
- Offers Widget Layers and screenshot-backed Visual Frames modes.
- Surfaces Stack, Overlay, Dialog, ModalBottomSheet, ModalBarrier, menus, and tooltips that are difficult to inspect in a flat tree.
- Synchronizes selection between the device, widget tree, 3D scene, and IDE source navigation.
- Refreshes automatically from Flutter frame events and supports frozen snapshots.
- Provides collapsible tree branches and resizable inspector panels.
- Supports right-mouse orbit controls synchronized with the view sliders.
- Adapts between wide three-panel and compact layouts.
Interaction
- Click a layer or tree node to select it, highlight it on the device, and navigate to its source when the IDE supports Flutter tool events.
- Enable device selection mode with the hand button, then tap a widget on the device to reveal it in the tree and 3D scene.
- Hold the right mouse button and drag over the scene to orbit the view.
- Switch between Widget Layers and Visual Frames from the toolbar.
Local development
Run the complex layout scenario host from example/:
cd example
flutter run
After changing extension source, rebuild the bundled DevTools web application from the package root:
dart run devtools_extensions build_and_copy \
--source=. \
--dest=extension/devtools
Validate the package and extension:
flutter analyze
flutter test
dart run devtools_extensions validate --package=.
dart pub publish --dry-run
See CONTRIBUTING.md for the contribution workflow.
Architecture
lib/
├── data/ # VM Service clients and repositories
├── domain/ # Inspector models and spatial projection
├── src/ # DevTools and local scenario entry points
└── ui/ # MVVM view models and inspector widgets
example/ # Stack, overlay, sheet, and nested-dialog scenario host
extension/ # DevTools configuration and prebuilt web assets
Limitations
Visual Frames uses Flutter's official Inspector screenshot service. Effects already composited by the engine, including some transparent blends, shaders, and platform views, cannot always be separated losslessly and remain visible in the composite frame.
License
Libraries
- data/models/inspector_protocol
- data/repositories/inspector_repository
- data/repositories/vm_inspector_repository
- data/services/inspector_vm_service
- domain/models/inspector_node
- domain/models/projected_node
- domain/models/visual_frame
- domain/use_cases/project_scene
- flutter_3d_inspector
- A spatial layout inspector extension for Flutter DevTools.
- main
- scenarios/scenario_app
- scenarios/scenario_controller
- scenarios/scenario_gallery
- ui/features/inspector/view_models/inspector_view_model
- ui/features/inspector/views/inspector_screen
- ui/features/inspector/views/inspector_tree_panel
- ui/features/inspector/views/node_details_panel
- ui/features/inspector/views/scene_viewport