UiElement class

One rendered element in a UiObservation.

elementId is snapshot-scoped and ephemeral. testId is the developer EDL id when present; they are not interchangeable.

Constructors

UiElement({required String elementId, String? testId, String? type, String? role, String? label, String? text, String? hint, List<String> options = const [], ElementLocator? suggestedLocator, String? locatorWarning, UiElementState state = const UiElementState(), UiBounds? bounds, List<String> actions = const [], List<UiElement> children = const [], Map<String, Object?> metadata = const {}})
const
UiElement.fromJson(Map<String, dynamic> json)
factory

Properties

actions → List<String>
final
bounds → UiBounds?
final
children → List<UiElement>
final
elementId → String
final
hashCode → int
The hash code for this object.
no setterinherited
hint → String?
Placeholder / hint for text inputs (never treated as text value).
final
label → String?
final
locatorWarning → String?
Why suggestedLocator is missing (no stable locator / ambiguous).
final
metadata → Map<String, Object?>
final
options → List<String>
Selectable labels for dropdowns (from widget items, not the open menu).
final
role → String?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → UiElementState
final
suggestedLocator → ElementLocator?
Verified locator for this element, when unique in the tree.
final
testId → String?
final
text → String?
final
type → String?
final

Methods

copyWith({String? elementId, String? testId, String? type, String? role, String? label, String? text, String? hint, List<String>? options, ElementLocator? suggestedLocator, bool clearSuggestedLocator = false, String? locatorWarning, bool clearLocatorWarning = false, UiElementState? state, UiBounds? bounds, List<String>? actions, List<UiElement>? children, Map<String, Object?>? metadata}) → UiElement
Copy with selected fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

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