copyWith method

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

Implementation

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