WidgetInspectorService class

Service used by GUI tools to interact with the WidgetInspector.

Calls to this object are typically made from GUI tools such as the Flutter IntelliJ Plugin using the Dart VM Service protocol. This class uses its own object id and manages object lifecycles itself instead of depending on the object ids specified by the VM Service Protocol because the VM Service Protocol ids expire unpredictably. Object references are tracked in groups so that tools that clients can use dereference all objects in a group with a single operation making it easier to avoid memory leaks.

All methods in this class are appropriate to invoke from debugging tools using the Observatory service protocol to evaluate Dart expressions of the form WidgetInspectorService.instance.methodName(arg1, arg2, ...). If you make changes to any instance method of this class you need to verify that the Flutter IntelliJ Plugin widget inspector support still works with the changes.

All methods returning String values return JSON.

Properties

selection InspectorSelection
Ground truth tracking what object(s) are currently selected used by both GUI tools such as the Flutter IntelliJ Plugin and the WidgetInspector displayed on the device.
final
selectionChangedCallback InspectorSelectionChangedCallback
Callback typically registered by the WidgetInspector to receive notifications when selection changes. [...]
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

disposeAllGroups() → void
Clear all InspectorService object references. [...]
disposeGroup(String name) → void
Free all references to objects in a group. [...]
disposeId(String id, String groupName) → void
Remove the object with the specified id from the specified object group. [...]
getChildren(String diagnosticsNodeId, String groupName) String
Returns a JSON representation of the children of the DiagnosticsNode object that diagnosticsNodeId references.
getParentChain(String id, String groupName) String
Returns JSON representing the chain of DiagnosticsNode instances from root of thee tree to the Element or RenderObject matching id. [...]
getProperties(String diagnosticsNodeId, String groupName) String
Returns a JSON representation of the properties of the DiagnosticsNode object that diagnosticsNodeId references.
getRootRenderObject(String groupName) String
Returns a JSON representation of the DiagnosticsNode for the root RenderObject.
getRootWidget(String groupName) String
Returns a JSON representation of the DiagnosticsNode for the root Element.
getSelectedRenderObject(String previousSelectionId, String groupName) String
Returns a DiagnosticsNode representing the currently selected RenderObject. [...]
getSelectedWidget(String previousSelectionId, String groupName) String
Returns a DiagnosticsNode representing the currently selected Element. [...]
isWidgetCreationTracked() bool
Returns whether Widget creation locations are available. [...]
isWidgetTreeReady([String groupName ]) bool
Returns whether the application has rendered its first frame and it is appropriate to display the Widget tree in the inspector.
setPubRootDirectories(List<Object> pubRootDirectories) → void
Set the list of directories that should be considered part of the local project. [...]
setSelection(Object object, [ String groupName ]) bool
Set the WidgetInspector selection to the specified object if it is a valid object to set as the inspector selection. [...]
setSelectionById(String id, [ String groupName ]) bool
Set the WidgetInspector selection to the object matching the specified id if the object is valid object to set as the inspector selection. [...]
toId(Object object, String groupName) String
Returns a unique id for object that will remain live at least until disposeGroup is called on groupName or dispose is called on the id returned by this method.
toObject(String id, [ String groupName ]) Object
Returns the Dart object associated with a reference id. [...]
toObjectForSourceLocation(String id, [ String groupName ]) Object
Returns the object to introspect to determine the source location of an object's class. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Properties

instance WidgetInspectorService
The current WidgetInspectorService.
read-only