override method

TextStyle override({
  1. String? fontFamily,
  2. Color? color,
  3. double? fontSize,
  4. FontWeight? fontWeight,
  5. double? letterSpacing,
  6. FontStyle? fontStyle,
  7. bool useGoogleFonts = true,
  8. TextDecoration? decoration,
  9. double? lineHeight,
})

Implementation

TextStyle override({
  String? fontFamily,
  Color? color,
  double? fontSize,
  FontWeight? fontWeight,
  double? letterSpacing,
  FontStyle? fontStyle,
  bool useGoogleFonts = true,
  TextDecoration? decoration,
  double? lineHeight,
}) {
  if (useGoogleFonts) {
    return GoogleFonts.getFont(
      fontFamily ?? 'Inter',
      color: color ?? this.color,
      fontSize: fontSize ?? this.fontSize,
      letterSpacing: letterSpacing ?? this.letterSpacing,
      fontWeight: fontWeight ?? this.fontWeight,
      fontStyle: fontStyle ?? this.fontStyle,
      decoration: decoration,
      height: lineHeight,
    );
  }
  return copyWith(
    fontFamily: fontFamily,
    color: color,
    fontSize: fontSize,
    letterSpacing: letterSpacing,
    fontWeight: FontWeight.w300,
    fontStyle: fontStyle,
    decoration: decoration,
    height: lineHeight,
  );
}