onText method

Text onText({
  1. TextSpan? textSpan,
  2. TextStyle? style,
  3. TextAlign? textAlign,
  4. TextDirection? textDirection,
  5. Locale? locale,
  6. bool? softWrap,
  7. TextOverflow? overflow,
  8. double? textScaleFactor,
  9. int? maxLines,
  10. String? semanticsLabel,
  11. TextWidthBasis? textWidthBasis,
  12. TextHeightBehavior? textHeightBehavior,
})

Implementation

Text onText({
  TextSpan? textSpan,
  TextStyle? style,
  TextAlign? textAlign,
  TextDirection? textDirection,
  Locale? locale,
  bool? softWrap,
  TextOverflow? overflow,
  double? textScaleFactor,
  int? maxLines,
  String? semanticsLabel,
  TextWidthBasis? textWidthBasis,
  ui.TextHeightBehavior? textHeightBehavior,
}) {
  this.style = style ?? this.style;
  this.textAlign = textAlign ?? this.textAlign;
  this.textDirection = textDirection ?? this.textDirection;
  this.locale = locale ?? this.locale;
  this.softWrap = softWrap ?? this.softWrap;
  this.overflow = overflow ?? this.overflow;
  this.textScaleFactor = textScaleFactor ?? this.textScaleFactor;
  this.maxLines = maxLines ?? this.maxLines;
  this.semanticsLabel = semanticsLabel ?? this.semanticsLabel;
  this.textWidthBasis = textWidthBasis ?? this.textWidthBasis;
  this.textHeightBehavior = textHeightBehavior ?? this.textHeightBehavior;
  Text newWidget;
  // text getter
  if (textSpan == null) {
    newWidget = text;
  } else {
    this.textSpan = textSpan;
    // richText getter
    newWidget = richText;
  }
  return newWidget;
}