SemanticLabelRule class
Flags semantics nodes that are interactive (expose a tap or long-press action) but carry no label, value, or tooltip for assistive technology to announce.
Reads the actual SemanticsNode tree rather than the Element tree, so
it catches widgets that set semantics via a custom RenderObject (e.g.
IconButton, InkWell) as well as ones using an explicit Semantics
widget — either way, this is what a screen reader would actually
encounter. Text fields are skipped, since they're conventionally
described by their value/hint rather than a label. Mirrors the filtering
in Flutter's own flutter_test LabeledTapTargetGuideline.
- Inheritance
-
- Object
- A11ySemanticsRule
- SemanticLabelRule
Constructors
- SemanticLabelRule()
-
const
Properties
- description → String
-
Short human-readable description of what this rule checks.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Stable identifier used in A11yViolation.ruleId and reports.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
check(
List< A11ySemanticsNodeInfo> nodes) → List<A11yViolation> -
Inspects
nodes— a snapshot captured by SemanticsTreeWalker — and returns any violations found.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited