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