updateNode method
Update the information associated with the node with the given id
.
The semantics nodes form a tree, with the root of the tree always having
an id of zero. The children
are the ids of the nodes that are immediate
children of this node. The system retains the nodes that are currently
reachable from the root. A given update need not contain information for
nodes that do not change in the update. If a node is not reachable from
the root after an update, the node will be discarded from the tree.
The flags
are a bit field of SemanticsFlags that apply to this node.
The actions
are a bit field of SemanticsActions that can be undertaken
by this node. If the user wishes to undertake one of these actions on this
node, the Window.onSemanticsAction will be called with id
and one of
the possible SemanticsActions. Because the semantics tree is maintained
asynchronously, the Window.onSemanticsAction callback might be called
with an action that is no longer possible.
The label
is a string that describes this node. The value
property
describes the current value of the node as a string. The increasedValue
string will become the value
string after a SemanticsAction.increase
action is performed. The decreasedValue
string will become the value
string after a SemanticsAction.decrease action is performed. The hint
string describes what result an action performed on this node has. The
reading direction of all these strings is given by textDirection
.
The fields 'textSelectionBase' and 'textSelectionExtent' describe the
currently selected text within value
.
For scrollable nodes scrollPosition
describes the current scroll
position in logical pixel. scrollExtentMax
and scrollExtentMin
describe the maximum and minimum in-rage values that scrollPosition
can
be. Both or either may be infinity to indicate unbound scrolling. The
value for scrollPosition
can (temporarily) be outside this range, for
example during an overscroll.
The rect
is the region occupied by this node in its own coordinate
system.
The transform
is a matrix that maps this node's coordinate system into
its parent's coordinate system.
Implementation
void updateNode({
int id,
int flags,
int actions,
int textSelectionBase,
int textSelectionExtent,
double scrollPosition,
double scrollExtentMax,
double scrollExtentMin,
Rect rect,
String label,
String hint,
String value,
String increasedValue,
String decreasedValue,
TextDirection textDirection,
int nextNodeId,
int previousNodeId,
Float64List transform,
Int32List children,
}) {
if (transform.length != 16)
throw new ArgumentError('transform argument must have 16 entries.');
_updateNode(id,
flags,
actions,
textSelectionBase,
textSelectionExtent,
scrollPosition,
scrollExtentMax,
scrollExtentMin,
rect.left,
rect.top,
rect.right,
rect.bottom,
label,
hint,
value,
increasedValue,
decreasedValue,
textDirection != null ? textDirection.index + 1 : 0,
nextNodeId ?? -1,
previousNodeId ?? -1,
transform,
children,);
}