font method

TextStyle font({
  1. double size = 14,
  2. NUIThemePair<Color>? colorPair,
  3. Color? color,
  4. String? fontName,
  5. NUIFontType fontType = NUIFontType.REGULAR,
  6. bool isBold = false,
  7. Shadow? shadow,
  8. FontWeight? fontWeight,
  9. TextDecoration decoration = TextDecoration.none,
  10. bool isItalic = false,
  11. List<FontFeature>? fontFeatures,
})

Implementation

TextStyle font({
  double size = 14,
  NUIThemePair<Color>? colorPair,
  Color? color,
  String? fontName,
  NUIFontType fontType = NUIFontType.REGULAR,
  bool isBold = false,
  Shadow? shadow,
  FontWeight? fontWeight,
  TextDecoration decoration = TextDecoration.none,
  bool isItalic = false,
  List<FontFeature>? fontFeatures
}){
  return TextStyle(
      fontSize: (size) * (_textScaleFactor ?? 1.0),
      color: colorPair != null ? this.color(colorPair) : color ?? Colors.black,
      fontWeight: fontWeight ?? (isBold ? FontWeight.bold : FontWeight.normal),
      shadows: shadow != null ? [shadow] : [],
      decoration: decoration,
      fontFamily: fontName ?? _fontTheme?.fontByType(fontType),
      fontStyle: isItalic ? FontStyle.italic : FontStyle.normal,
      fontFeatures: fontFeatures
  );
}