SemanticsNodeData class

One node of a serializable, Flutter-free snapshot of a screen's semantics tree.

This mirrors the data Flutter exposes through SemanticsData, reduced to the fields the rules consult. Every rule is a pure function over a tree of these.

Annotations
  • @immutable

Constructors

SemanticsNodeData({required int id, String? identifier, String label = '', String value = '', String hint = '', String tooltip = '', Set<SemanticsFlagData> flags = const {}, Set<SemanticsActionData> actions = const {}, RectData bounds = RectData.zero, TextDirectionData textDirection = TextDirectionData.ltr, List<SemanticsNodeData> childrenInTraversalOrder = const [], SourceLocation? creator, TextStyleData? textStyle})
Creates a SemanticsNodeData.
const
SemanticsNodeData.fromJson(Map<String, dynamic> json)
Parses a SemanticsNodeData tree from json.
factory

Properties

actions Set<SemanticsActionData>
The actions this node can perform.
final
bounds RectData
The node's bounding rectangle in global logical pixels.
final
childrenInTraversalOrder List<SemanticsNodeData>
This node's children, in the order assistive technology traverses them.
final
creator SourceLocation?
Where the originating widget was created, when available.
final
flags Set<SemanticsFlagData>
The boolean semantic properties set on this node.
final
hashCode int
The hash code for this object.
no setteroverride
hint String
A hint describing what happens when the node is acted upon.
final
id int
A stable identifier for this node, unique within its snapshot.
final
identifier String?
The developer-assigned semantics identifier, from SemanticsProperties.identifier, when one was set.
final
isInteractive bool
Whether this node is interactive: it is a button or link, or it responds to a tap or long press.
no setter
label String
The node's accessible name, as a screen reader would announce it.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selfAndDescendants Iterable<SemanticsNodeData>
This node and all of its descendants, in pre-order (self first).
no setter
textDirection TextDirectionData
The reading direction in effect for this node.
final
textStyle TextStyleData?
The text style, populated only when this node paints text.
final
tooltip String
The node's tooltip, if any.
final
value String
The node's current value (e.g. the text in a field, a slider's value).
final

Methods

hasAction(SemanticsActionData action) bool
Whether this node can perform the given action.
hasFlag(SemanticsFlagData flag) bool
Whether this node has the given flag.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
The JSON representation of this node and its subtree.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override