WidgetIdentity class
Metadata describing the identity of a widget found via a hit-test.
Used by SemanticResolver to produce human-readable, finder-ready descriptions that can be turned into Flutter widget-test finder expressions.
Constructors
- WidgetIdentity({String? key, String? widgetType, String? text, String? tooltip, String? semanticLabel, Rect? bounds})
-
const
-
WidgetIdentity.fromJson(Map<
String, dynamic> json) -
factory
Properties
- bounds → Rect?
-
Screen-space bounding box of the matched render object.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isResolvable → bool
-
Whether there is enough information to generate a semantic finder
(i.e. something other than a raw absolute-offset fallback).
no setter
- key → String?
-
String representation of the widget's Key (e.g.
'submit_btn'from aValueKey<String>('submit_btn')), ornullif the widget had no key.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
The SemanticsNode.label from the nearest semantics node, if any.
final
- text → String?
-
Text content of the nearest descendant Text widget, if any.
final
- tooltip → String?
-
The Tooltip.message string if the widget is wrapped in a Tooltip.
final
- widgetType → String?
-
Runtime type name of the matched widget (e.g.
'ElevatedButton').final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toFinderExpression(
double fallbackDx, double fallbackDy) → String - Returns the best Flutter test finder expression for this identity.
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited