Text.rich constructor Null safety
- InlineSpan textSpan,
- {Key? key,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextAlign? textAlign,
- TextDirection? textDirection,
- Locale? locale,
- bool? softWrap,
- TextOverflow? overflow,
- double? textScaleFactor,
- int? maxLines,
- String? semanticsLabel,
- TextWidthBasis? textWidthBasis,
- TextHeightBehavior? textHeightBehavior,
- Color? selectionColor}
Creates a text widget with a InlineSpan.
The following subclasses of InlineSpan may be used to build rich text:
- TextSpans define text and children InlineSpans.
- WidgetSpans define embedded inline widgets.
The textSpan parameter must not be null.
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,
this.textScaleFactor,
this.maxLines,
this.semanticsLabel,
this.textWidthBasis,
this.textHeightBehavior,
this.selectionColor,
}) : assert(
textSpan != null,
'A non-null TextSpan must be provided to a Text.rich widget.',
),
data = null;