Returns a function that will annotate a SemanticsNode
with the semantics
of this RenderObject
.
To annotate a SemanticsNode for this node, return an annotator that
adds the annotations. When the behavior of the annotator would
change (e.g. the box is now checked rather than unchecked), call
markNeedsSemanticsUpdate
to indicate to the rendering system
that the semantics tree needs to be rebuilt.
To introduce a new SemanticsNode, set hasSemantics to true for this object. The function returned by this function will be used to annotate the SemanticsNode for this object.
Semantic annotations are persistent. Values set in one pass will still be set in the next pass. Therefore it is important to explicitly set fields to false once they are no longer true; setting them to true when they are to be enabled, and not setting them at all when they are not, will mean they remain set once enabled once and will never get unset.
If the value return will change from null to non-null (or vice versa), and
hasSemantics
isn't true, then the associated call to
markNeedsSemanticsUpdate
must not have onlyChanges
set, as it is
possible that the node should be entirely removed.
Source
@override SemanticsAnnotator get semanticsAnnotator => isSemanticBoundary ? _annotate : null;