Text.rich constructor

const Text.rich(
  1. InlineSpan textSpan,
  2. {Key? key,
  3. TextStyle? style,
  4. StrutStyle? strutStyle,
  5. TextAlign? textAlign,
  6. TextDirection? textDirection,
  7. Locale? locale,
  8. bool? softWrap,
  9. TextOverflow? overflow,
  10. @Deprecated('Use textScaler instead. ' 'Use of textScaleFactor was deprecated in preparation for the upcoming nonlinear text scaling support. ' 'This feature was deprecated after v3.12.0-2.0.pre.') double? textScaleFactor,
  11. TextScaler? textScaler,
  12. int? maxLines,
  13. String? semanticsLabel,
  14. TextWidthBasis? textWidthBasis,
  15. TextHeightBehavior? textHeightBehavior,
  16. Color? selectionColor}
)

Creates a text widget with a InlineSpan.

The following subclasses of InlineSpan may be used to build rich text:

See RichText which provides a lower-level way to draw text.

Implementation

const Text.rich(
  InlineSpan this.textSpan, {
  super.key,
  this.style,
  this.strutStyle,
  this.textAlign,
  this.textDirection,
  this.locale,
  this.softWrap,
  this.overflow,
  @Deprecated(
    'Use textScaler instead. '
    'Use of textScaleFactor was deprecated in preparation for the upcoming nonlinear text scaling support. '
    'This feature was deprecated after v3.12.0-2.0.pre.',
  )
  this.textScaleFactor,
  this.textScaler,
  this.maxLines,
  this.semanticsLabel,
  this.textWidthBasis,
  this.textHeightBehavior,
  this.selectionColor,
}) : data = null,
     assert(
       textScaler == null || textScaleFactor == null,
       'textScaleFactor is deprecated and cannot be specified when textScaler is specified.',
     );