copyWith method

TextStyle copyWith({
  1. num? fontSize,
  2. FontWeight? fontWeight,
  3. String? fontStyle,
  4. Color? color,
  5. num? letterSpacing,
  6. num? height,
  7. String? fontFamily,
  8. TextDecoration? decoration,
})

Returns a copy with selected values replaced.

Implementation

TextStyle copyWith(
        {num? fontSize,
        FontWeight? fontWeight,
        String? fontStyle,
        Color? color,
        num? letterSpacing,
        num? height,
        String? fontFamily,
        TextDecoration? decoration}) =>
    TextStyle(
        fontSize: fontSize ?? this.fontSize,
        fontWeight: fontWeight ?? this.fontWeight,
        fontStyle: fontStyle ?? this.fontStyle,
        color: color ?? this.color,
        letterSpacing: letterSpacing ?? this.letterSpacing,
        height: height ?? this.height,
        fontFamily: fontFamily ?? this.fontFamily,
        decoration: decoration ?? this.decoration);