RichText constructor

RichText({Key key, @required InlineSpan text, TextAlign textAlign: TextAlign.start, TextDirection textDirection, bool softWrap: true, TextOverflow overflow: TextOverflow.clip, double textScaleFactor: 1.0, int maxLines, Locale locale, StrutStyle strutStyle, TextWidthBasis textWidthBasis: TextWidthBasis.parent })

Creates a paragraph of rich text.

The text, textAlign, softWrap, overflow, 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.

The textDirection, if null, defaults to the ambient Directionality, which in that case must not be null.

Implementation

RichText({
  Key key,
  @required this.text,
  this.textAlign = TextAlign.start,
  this.textDirection,
  this.softWrap = true,
  this.overflow = TextOverflow.clip,
  this.textScaleFactor = 1.0,
  this.maxLines,
  this.locale,
  this.strutStyle,
  this.textWidthBasis = TextWidthBasis.parent,
}) : assert(text != null),
     assert(textAlign != null),
     assert(softWrap != null),
     assert(overflow != null),
     assert(textScaleFactor != null),
     assert(maxLines == null || maxLines > 0),
     assert(textWidthBasis != null),
     super(key: key, children: _extractChildren(text));