admits method

bool admits(
  1. TextParagraph paragraph
)

Whether paragraph is valid in this text. The engine checks maxLines.

Plain text admits paragraphs without paragraph or run attributes.

Implementation

bool admits(TextParagraph paragraph) =>
    paragraph.attributes == null &&
    paragraph.runs.every((run) => run.attributes == null);