copyWith method

TextStyle copyWith({
  1. Color? color,
  2. double? fontSize,
  3. FontWeight? fontWeight,
  4. FontStyle? fontStyle,
  5. double? letterSpacing,
  6. double? wordSpacing,
  7. TextBaseline? textBaseline,
  8. double? height,
  9. Locale? locale,
  10. Paint? foreground,
  11. Paint? background,
  12. List<Shadow>? shadows,
  13. List<FontFeature>? fontFeatures,
  14. TextDecoration? decoration,
  15. Color? decorationColor,
  16. TextDecorationStyle? decorationStyle,
  17. double? decorationThickness,
})

Implementation

TextStyle copyWith({
  Color? color,
  double? fontSize,
  FontWeight? fontWeight,
  FontStyle? fontStyle,
  double? letterSpacing,
  double? wordSpacing,
  TextBaseline? textBaseline,
  double? height,
  Locale? locale,
  Paint? foreground,
  Paint? background,
  List<Shadow>? shadows,
  List<FontFeature>? fontFeatures,
  TextDecoration? decoration,
  Color? decorationColor,
  TextDecorationStyle? decorationStyle,
  double? decorationThickness,
}) {
  return TextStyle(
    color: color ?? this.color,
    fontSize: fontSize ?? this.fontSize,
    fontWeight: fontWeight ?? this.fontWeight,
    fontStyle: fontStyle ?? this.fontStyle,
    letterSpacing: letterSpacing ?? this.letterSpacing,
    wordSpacing: wordSpacing ?? this.wordSpacing,
    textBaseline: textBaseline ?? this.textBaseline,
    height: height ?? this.height,
    locale: locale ?? this.locale,
    foreground: foreground ?? this.foreground,
    background: background ?? this.background,
    shadows: shadows ?? this.shadows,
    fontFeatures: fontFeatures ?? this.fontFeatures,
    decoration: decoration ?? this.decoration,
    decorationColor: decorationColor ?? this.decorationColor,
    decorationStyle: decorationStyle ?? this.decorationStyle,
    decorationThickness: decorationThickness ?? this.decorationThickness,
  );
}