textStyle static method

TextStyle? textStyle(
  1. FontModel? fontModel
)

Implementation

static TextStyle? textStyle(FontModel? fontModel) {
  if (fontModel == null) return null;
  try {
    return GoogleFonts.getFont(fontModel.fontName!,
        fontSize: fontModel.size,
        fontWeight: FontTools.toFontWeight(fontModel.weight),
        color: RgbHelper.color(rgbo: fontModel.color),
        fontStyle: FontStyle.italic);
  } catch (_) {
    return null;
  }
}