expandChild method

Iterable<SemanticNode> expandChild(
  1. SemanticNode node, {
  2. bool imageCandidate = false,
})

With imageCandidate, a dissolved node leaves a pending SemanticImage ahead of its children for ImageEnricher to confirm or drop.

Implementation

Iterable<SemanticNode> expandChild(SemanticNode node, {bool imageCandidate = false}) {
  if (!_isNoisyPassThrough(node)) return [node];
  if (!imageCandidate) return node.children;
  return [
    SemanticImage(
      glintId: node.glintId,
      isBackground: node.children.isNotEmpty,
      candidate: true,
    ),
    ...node.children,
  ];
}