toTextStyle method
Implementation
TextStyle toTextStyle({
Color? color,
Color? backgroundColor,
bool bold = false,
bool italic = false,
TextDecoration decoration = TextDecoration.none,
Color? decorationColor,
double? letterSpacing,
}) {
return TextStyle(
fontSize: fontSize,
height: height,
fontFamily: fontFamily,
fontFamilyFallback: fontFamilyFallback,
fontFeatures: fontFeatures,
color: color,
backgroundColor: backgroundColor,
fontWeight: bold ? FontWeight.bold : FontWeight.normal,
fontStyle: italic ? FontStyle.italic : FontStyle.normal,
decoration: decoration,
decorationColor: decorationColor ?? color,
letterSpacing: letterSpacing,
// Splits the leading evenly above and below rather than in proportion
// to the font's own ascent, so a fallback glyph is not nudged off the
// shared baseline by metrics the primary font never had.
leadingDistribution: TextLeadingDistribution.even,
);
}