copyWith method

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

Copies this Text while overriding the provided properties.

Implementation

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