UiElement class

A parsed representation of a SemanticsNode, describing a single interactive or informative UI element on screen.

Constructors

UiElement({required int nodeId, required String label, String? value, String? hint, required UiElementType type, required List<String> availableActions, List<String> parentLabels = const [], required Rect bounds, bool isEnabled = true, bool isFocused = false, bool? isChecked})
const

Properties

availableActions → List<String>
List of actions this element supports (tap, longPress, setText, etc.).
final
bounds → Rect
Bounding rectangle of the element on screen.
final
hashCode → int
The hash code for this object.
no setterinherited
hint → String?
Accessibility hint (e.g. "Double tap to activate").
final
isChecked → bool?
Whether this element is checked (for checkboxes/toggles).
final
isEnabled → bool
Whether this element is currently enabled.
final
isFocused → bool
Whether this element is currently focused.
final
label → String
The accessible label (button text, field label, etc.).
final
nodeId → int
The SemanticsNode ID, used to target this element for actions.
final
parentLabels → List<String>
Labels of parent and sibling nodes, used for disambiguation when multiple elements share the same label (e.g., multiple "Add" buttons in a product list — the parentLabels contain the product name).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → UiElementType
Detected element type based on semantics flags.
final
value → String?
Current value (text field content, slider position, etc.).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toPromptString() → String
Format this element as a human-readable string for the LLM prompt.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited