computeSemanticsInformation method

  1. @override
void computeSemanticsInformation (List<InlineSpanSemanticsInformation> collector)
override

Walks the InlineSpan tree and accumulates a list of InlineSpanSemanticsInformation objects.

This method should not be directly called. Use getSemanticsInformation instead.

PlaceholderSpans in the tree will be represented with a InlineSpanSemanticsInformation.placeholder value.

Implementation

@override
void computeSemanticsInformation(List<InlineSpanSemanticsInformation> collector) {
  assert(debugAssertIsValid());
  if (text != null || semanticsLabel != null) {
    collector.add(InlineSpanSemanticsInformation(
      text,
      semanticsLabel: semanticsLabel,
      recognizer: recognizer,
    ));
  }
  if (children != null) {
    for (InlineSpan child in children) {
      child.computeSemanticsInformation(collector);
    }
  }
}