getTextStyle static method

dynamic getTextStyle(
  1. String fontFamily,
  2. double fontSize,
  3. FontWeight fontWeight,
  4. Color? color,
  5. TextDecoration? textDecoration,
  6. FontStyle? fontStyle,
  7. double? lineHeight,
  8. double? letterSpacing,
)

Implementation

static getTextStyle(
    String fontFamily,
    double fontSize,
    FontWeight fontWeight,
    Color? color,
    TextDecoration? textDecoration,
    FontStyle? fontStyle,
    double? lineHeight,
    double? letterSpacing) {
  return !GoogleFontsUtils().isGoogleFont(fontFamily)
      ? TextStyle(
          fontFamily: fontFamily,
          fontSize: fontSize,
          fontWeight: fontWeight,
          color: color,
          decoration: textDecoration,
          fontStyle: fontStyle,
          height: lineHeight,
          letterSpacing: letterSpacing,
        )
      : GoogleFonts.getFont(
          fontFamily,
          fontSize: fontSize,
          fontWeight: fontWeight,
          color: color,
          decoration: textDecoration,
          fontStyle: fontStyle,
          height: lineHeight,
          letterSpacing: letterSpacing,
        );
}