copyWith method

Text copyWith({
  1. Key? key,
  2. String? data,
  3. TextAlign? textAlign,
  4. bool? softWrap,
  5. TextOverflow? overflow,
  6. double? textScaleFactor,
  7. int? maxLines,
  8. String? semanticsLabel,
  9. TextWidthBasis? textWidthBasis,
  10. TextHeightBehavior? textHeightBehavior,
  11. Locale? locale,
  12. StrutStyle? strutStyle,
  13. Color? color,
  14. double? fontSize,
  15. FontWeight? fontWeight,
  16. FontStyle? fontStyle,
  17. double? letterSpacing,
  18. double? wordSpacing,
  19. TextBaseline? textBaseline,
  20. String? fontFamily,
  21. List<String>? fontFamilyFallback,
  22. Paint? background,
  23. Paint? foreground,
  24. double? height,
  25. List<Shadow>? shadows,
  26. List<FontFeature>? fontFeatures,
  27. TextDecoration? decoration,
  28. Color? decorationColor,
  29. TextDecorationStyle? decorationStyle,
  30. double? decorationThickness,
  31. 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),
      ),
    );