copyWith method

Text copyWith({
  1. Key? key,
  2. String? data,
  3. Locale? locale,
  4. int? maxLines,
  5. TextOverflow? overflow,
  6. bool? softWrap,
  7. StrutStyle? strutStyle,
  8. TextAlign? textAlign,
  9. TextDirection? textDirection,
  10. double? textScaleFactor,
  11. TextWidthBasis? textWidthBasis,
  12. Color? selectionColor,
  13. String? semanticsLabel,
  14. TextHeightBehavior? textHeightBehavior,
  15. TextStyle? style,
})

Implementation

Text copyWith({
  Key? key,
  String? data,
  Locale? locale,
  int? maxLines,
  TextOverflow? overflow,
  bool? softWrap,
  StrutStyle? strutStyle,
  TextAlign? textAlign,
  TextDirection? textDirection,
  double? textScaleFactor,
  TextWidthBasis? textWidthBasis,
  Color? selectionColor,
  String? semanticsLabel,
  TextHeightBehavior? textHeightBehavior,
  TextStyle? style,
}) {
  return Text(
    key: key ?? this.key,
    data ?? this.data ?? '',
    locale: locale ?? this.locale,
    maxLines: maxLines ?? this.maxLines,
    overflow: overflow ?? this.overflow,
    softWrap: softWrap ?? this.softWrap,
    strutStyle: strutStyle ?? this.strutStyle,
    textAlign: textAlign ?? this.textAlign,
    textDirection: textDirection ?? this.textDirection,
    textScaleFactor: textScaleFactor ?? this.textScaleFactor,
    textWidthBasis: textWidthBasis ?? this.textWidthBasis,
    selectionColor: selectionColor ?? this.selectionColor,
    semanticsLabel: semanticsLabel ?? this.semanticsLabel,
    textHeightBehavior: textHeightBehavior ?? this.textHeightBehavior,
    style: style ?? this.style,
  );
}