validateStory method

void validateStory(
  1. TextStory story
)

Validates run appearance and nested content, independent of the owner.

Implementation

void validateStory(TextStory story) {
  if (_validatedStories[story] == true) return;
  for (final table in story.contents) {
    table.validate();
  }
  for (final block in story.canonicalParagraphs) {
    if (block.runs.any((run) => !run.hasValidAppearance)) {
      throw StateError('Paragraph ${block.id} has invalid run appearance.');
    }
  }
  _validatedStories[story] = true;
}