copyWith method

TextStyle copyWith({
  1. double? fontSize,
  2. String? color,
  3. FontWeight? fontWeight,
  4. String? fontFamily,
  5. String? backgroundColor,
  6. TextDecoration? decoration,
  7. double? letterSpacing,
  8. double? wordSpacing,
  9. double? lineHeight,
})

Implementation

TextStyle copyWith({
  double? fontSize,
  String? color,
  FontWeight? fontWeight,
  String? fontFamily,
  String? backgroundColor,
  TextDecoration? decoration,
  double? letterSpacing,
  double? wordSpacing,
  double? lineHeight,
}) {
  return TextStyle(
    fontSize: fontSize ?? this.fontSize,
    color: color ?? this.color,
    fontWeight: fontWeight ?? this.fontWeight,
    fontFamily: fontFamily ?? this.fontFamily,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    decoration: decoration ?? this.decoration,
    letterSpacing: letterSpacing ?? this.letterSpacing,
    wordSpacing: wordSpacing ?? this.wordSpacing,
    lineHeight: lineHeight ?? this.lineHeight,
  );
}