unkeyedText method

List<UnkeyedText> unkeyedText()

Every span on this screen that no catalog claimed, with where it is.

The other half of translationKeys, and deliberately not called a list of untranslated strings: most of it has no key by construction — a formatted date, a name, a number read off a fixture. Classifying it is the reader's job, and the source location is there so the reader can do it.

Implementation

List<UnkeyedText> unkeyedText() {
  var found = <UnkeyedText>[];
  void visit(InspectNode node) {
    for (var text in node.unkeyedText) {
      found.add(
        UnkeyedText(
          text: text,
          node: node.id,
          layout: node.layout,
          source: node.source,
          offstage: node.offstage,
        ),
      );
    }
    for (var child in node.children) {
      visit(child);
    }
  }

  if (root case var root?) visit(root);
  return found;
}