GuestInspector class
Reads the live widget tree out of a running guest.
The structure and the source locations come from the framework's own
inspector, and everything else is ours. That split is forced rather than
chosen: --track-widget-creation stores a widget's location behind
_HasCreationLocation, a private interface in package:flutter, and Dart
mangles private names per library — so no code here can read it, by
language rule rather than by omission. WidgetInspectorService is the only
thing that can, and WidgetInspectorService.getRootWidgetSummaryTree is
how it hands the value out.
What we keep is the part that matters across processes: the identity. The
inspector's ids are per-object-group and die with the process; ours are
derived from the tree's shape, so a tree read by one fw invocation can be
asked about by the next. See InspectNode.id.
Constructors
- GuestInspector({required Element? rootOf(), required String? entryIdOf()})
Properties
- entryIdOf → String? Function()
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- rootOf → Element? Function()
-
The element the reported tree should start at — the demo, rather than the
catalog chrome above it.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
enableSemantics(
bool on) → void - Turns the semantics tree on or off.
-
hitTest(
double x, double y) → List< String> - The nodes under a point, outermost first.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
{InspectFilter? filter}) → InspectTree - The tree as of the last build.
-
readElements(
) → ({Map< String, Element> elements, InspectTree tree}) - read, and the element behind each node, by id.
-
readSemantics(
) → InspectSemantics -
The semantics tree, as
semantics_capture.dartshapes it. -
registerExtensions(
) → void -
Registers the extensions. Call once, before
runApp, beside the knobs and axes ones — an extension has to outlive every entry switch. -
renderObjectFor(
String id) → RenderObject? -
The render object
idnames, or null when this tree has no such node. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- treeFormat → const int
- Which way of describing a widget this walk writes, stamped on every tree it reads as InspectTree.format.