copyWith method
- 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,
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,
);