override method
TextStyle
override({
- String? fontFamily,
- Color? color,
- double? fontSize,
- FontWeight? fontWeight,
- double? letterSpacing,
- FontStyle? fontStyle,
- bool useGoogleFonts = true,
- TextDecoration? decoration,
- 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,
);
}