ParagraphEntry constructor

ParagraphEntry(
  1. String text,
  2. UiPaint paint,
  3. UiTextPaint textPaint,
  4. double maxTextwidth,
)

Creates a new ParagraphEntry by building and laying out a ui.Paragraph.

Implementation

ParagraphEntry(String text, UiPaint paint, UiTextPaint textPaint, double maxTextwidth) {
  ui.ParagraphBuilder builder = _buildParagraphBuilder(text, paint, textPaint);
  paragraph = builder.build();
  paragraph.layout(ui.ParagraphConstraints(width: maxTextwidth));
  assert(paragraph.longestLine > 0, "Paragraph width is negative ${paragraph.longestLine} for text $text and maxTextwidth $maxTextwidth");
}