getStyle static method
TextStyle
getStyle(
{ - TextStyle? textStyle,
- int? fontWeight = 500,
- bool muted = false,
- bool xMuted = false,
- double letterSpacing = 0.15,
- Color? color,
- TextDecoration decoration = TextDecoration.none,
- double? height,
- double wordSpacing = 0,
- double? fontSize,
})
Implementation
static TextStyle getStyle(
{TextStyle? textStyle,
int? fontWeight = 500,
bool muted = false,
bool xMuted = false,
double letterSpacing = 0.15,
Color? color,
TextDecoration decoration = TextDecoration.none,
double? height,
double wordSpacing = 0,
double? fontSize}) {
double? finalFontSize = fontSize != null
? fontSize
: (textStyle == null ? 40 : textStyle.fontSize);
Color? finalColor;
if (color == null) {
Color themeColor =
FxAppTheme.getThemeFromThemeMode().colorScheme.onBackground;
finalColor = xMuted
? themeColor.withAlpha(160)
: (muted ? themeColor.withAlpha(200) : themeColor);
} else {
finalColor = xMuted
? color.withAlpha(160)
: (muted ? color.withAlpha(200) : color);
}
return _fontFamily(
fontSize: finalFontSize,
fontWeight: _defaultFontWeight[fontWeight] ?? FontWeight.w400,
letterSpacing: letterSpacing,
color: finalColor,
decoration: decoration,
height: height,
wordSpacing: wordSpacing);
}