RenderParagraph constructor

RenderParagraph(InlineSpan text, { TextAlign textAlign: TextAlign.start, @required TextDirection textDirection, bool softWrap: true, TextOverflow overflow: TextOverflow.clip, double textScaleFactor: 1.0, int maxLines, TextWidthBasis textWidthBasis: TextWidthBasis.parent, Locale locale, StrutStyle strutStyle, List<RenderBox> children })

Creates a paragraph render object.

The text, textAlign, textDirection, overflow, softWrap, and textScaleFactor arguments must not be null.

The maxLines property may be null (and indeed defaults to null), but if it is not null, it must be greater than zero.

Implementation

RenderParagraph(InlineSpan text, {
  TextAlign textAlign = TextAlign.start,
  @required TextDirection textDirection,
  bool softWrap = true,
  TextOverflow overflow = TextOverflow.clip,
  double textScaleFactor = 1.0,
  int maxLines,
  TextWidthBasis textWidthBasis = TextWidthBasis.parent,
  Locale locale,
  StrutStyle strutStyle,
  List<RenderBox> children,
}) : assert(text != null),
     assert(text.debugAssertIsValid()),
     assert(textAlign != null),
     assert(textDirection != null),
     assert(softWrap != null),
     assert(overflow != null),
     assert(textScaleFactor != null),
     assert(maxLines == null || maxLines > 0),
     assert(textWidthBasis != null),
     _softWrap = softWrap,
     _overflow = overflow,
     _textPainter = TextPainter(
       text: text,
       textAlign: textAlign,
       textDirection: textDirection,
       textScaleFactor: textScaleFactor,
       maxLines: maxLines,
       ellipsis: overflow == TextOverflow.ellipsis ? _kEllipsis : null,
       locale: locale,
       strutStyle: strutStyle,
       textWidthBasis: textWidthBasis,
     ) {
  addAll(children);
  _extractPlaceholderSpans(text);
}