copyWith method
Text
copyWith({
- Key? key,
- String? data,
- TextAlign? textAlign,
- bool? softWrap,
- TextOverflow? overflow,
- double? textScaleFactor,
- int? maxLines,
- String? semanticsLabel,
- TextWidthBasis? textWidthBasis,
- TextHeightBehavior? textHeightBehavior,
- Locale? locale,
- StrutStyle? strutStyle,
- Color? color,
- double? fontSize,
- FontWeight? fontWeight,
- FontStyle? fontStyle,
- double? letterSpacing,
- double? wordSpacing,
- TextBaseline? textBaseline,
- String? fontFamily,
- List<
String> ? fontFamilyFallback, - Paint? background,
- Paint? foreground,
- double? height,
- List<
Shadow> ? shadows, - List<
FontFeature> ? fontFeatures, - TextDecoration? decoration,
- Color? decorationColor,
- TextDecorationStyle? decorationStyle,
- double? decorationThickness,
- String? debugLabel,
Implementation
Text copyWith({
Key? key,
String? data,
TextAlign? textAlign,
bool? softWrap,
TextOverflow? overflow,
double? textScaleFactor,
int? maxLines,
String? semanticsLabel,
TextWidthBasis? textWidthBasis,
TextHeightBehavior? textHeightBehavior,
Locale? locale,
StrutStyle? strutStyle,
Color? color,
double? fontSize,
FontWeight? fontWeight,
FontStyle? fontStyle,
double? letterSpacing,
double? wordSpacing,
TextBaseline? textBaseline,
String? fontFamily,
List<String>? fontFamilyFallback,
Paint? background,
Paint? foreground,
double? height,
List<Shadow>? shadows,
List<FontFeature>? fontFeatures,
TextDecoration? decoration,
Color? decorationColor,
TextDecorationStyle? decorationStyle,
double? decorationThickness,
String? debugLabel,
}) =>
Text(
data ?? this.data!,
key: key ?? this.key,
textAlign: textAlign ?? this.textAlign,
softWrap: softWrap ?? this.softWrap,
overflow: overflow ?? this.overflow,
textScaleFactor: textScaleFactor ?? this.textScaleFactor,
maxLines: maxLines ?? this.maxLines,
semanticsLabel: semanticsLabel ?? this.semanticsLabel,
textWidthBasis: textWidthBasis ?? this.textWidthBasis,
textHeightBehavior: textHeightBehavior ?? this.textHeightBehavior,
locale: locale ?? this.locale,
strutStyle: strutStyle ?? this.strutStyle,
style: TextStyle(
color: color ?? (style != null ? style!.color : null),
fontSize: fontSize ?? (style != null ? style!.fontSize : null),
fontWeight: fontWeight ?? (style != null ? style!.fontWeight : null),
fontStyle: fontStyle ?? (style != null ? style!.fontStyle : null),
letterSpacing:
letterSpacing ?? (style != null ? style!.letterSpacing : null),
wordSpacing:
wordSpacing ?? (style != null ? style!.wordSpacing : null),
textBaseline:
textBaseline ?? (style != null ? style!.textBaseline : null),
fontFamily: fontFamily ?? (style != null ? style!.fontFamily : null),
fontFamilyFallback: fontFamilyFallback ??
(style != null ? style!.fontFamilyFallback : null),
background: background ?? (style != null ? style!.background : null),
foreground: foreground ?? (style != null ? style!.foreground : null),
height: height ?? (style != null ? style!.height : null),
shadows: shadows ?? (style != null ? style!.shadows : null),
fontFeatures:
fontFeatures ?? (style != null ? style!.fontFeatures : null),
decoration: decoration ?? (style != null ? style!.decoration : null),
decorationColor: decorationColor ??
(style != null ? style!.decorationColor : null),
decorationStyle: decorationStyle ??
(style != null ? style!.decorationStyle : null),
decorationThickness: decorationThickness ??
(style != null ? style!.decorationThickness : null),
debugLabel: debugLabel ?? (style != null ? style!.debugLabel : null),
),
);