WrappableText constructor

WrappableText({
  1. Key? key,
  2. required TextSpan text,
  3. FCClear clear = FCClear.none,
  4. TextAlign? textAlign,
  5. TextDirection? textDirection,
  6. TextOverflow? overflow,
  7. @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 = 1.0,
  8. TextScaler textScaler = TextScaler.noScaling,
  9. int? maxLines,
  10. Locale? locale,
  11. StrutStyle? strutStyle,
  12. TextHeightBehavior? textHeightBehavior,
  13. double indent = 0.0,
  14. EdgeInsetsGeometry margin = EdgeInsets.zero,
  15. EdgeInsetsGeometry padding = EdgeInsets.zero,
})

Creates a paragraph of rich text, that when used in a FloatColumn can wrap around floated siblings.

The text, clear, and indent arguments must not be null.

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

Implementation

WrappableText({
  this.key,
  required this.text,
  this.clear = FCClear.none,
  this.textAlign,
  this.textDirection,
  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.',
  )
  double textScaleFactor = 1.0,
  TextScaler textScaler = TextScaler.noScaling,
  this.maxLines,
  this.locale,
  this.strutStyle,
  this.textHeightBehavior,
  this.indent = 0.0,
  this.margin = EdgeInsets.zero,
  this.padding = EdgeInsets.zero,
})  : assert(
        // ignore: unnecessary_null_comparison
        text != null,
        'A non-null TextSpan must be provided to a WrappableText.',
      ),
      assert(
          textScaleFactor == 1.0 ||
              identical(textScaler, TextScaler.noScaling),
          'Use textScaler instead.'),
      textScaler = _effectiveTextScalerFrom(textScaler, textScaleFactor),
      assert(maxLines == null || maxLines > 0);