VisualTree
Inspect Flutter widget and render-object hierarchy through the shared native ui.* visual-tree tools.
AnsightFlutterInstrumentation.install() registers Flutter handlers and calls enableFlutterVisualTreeProvider(). The shared native visual-tree suite can then return Flutter as a source alongside the platform-native hierarchy.
Enable native tools in the runtime:
final options = createOptionsBuilder()
.withRemoteTools(
const AnsightRemoteToolsOptions(visualTree: true),
)
.withReadOnlyToolAccess()
.build();
Use ui.get_visual_tree to discover sources and capture the tree, ui.inspect_node for node details, and ui.get_screenshot for an on-demand image. Native and Flutter sources use the shared compact visual-tree v2 contract, including a top-level types registry, node typeId references, semantic roles/actions, stable string ValueKey automation ids, and platform-neutral presentation data. Overlay tools are available when the native provider supports them.
For Flutter-specific search and route state, use Flutter Inspection. Widget labels, keys, text, diagnostics, and layout bounds may contain sensitive app data.