KrakenRenderParagraph constructor

KrakenRenderParagraph(
  1. InlineSpan text, {
  2. TextAlign textAlign = TextAlign.start,
  3. required TextDirection textDirection,
  4. bool softWrap = true,
  5. TextOverflow overflow = TextOverflow.clip,
  6. double textScaleFactor = 1.0,
  7. int? maxLines,
  8. Locale? locale,
  9. StrutStyle? strutStyle,
  10. TextWidthBasis textWidthBasis = TextWidthBasis.parent,
  11. TextHeightBehavior? textHeightBehavior,
  12. 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

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