small5 method

TextStyle small5({
  1. Color? color,
  2. bool? isBold,
  3. String? pageName,
  4. TextDecoration? decoration,
  5. Color? backgroundColor,
  6. String? fontFamily,
  7. FontWeight fontWeight = FontWeight.normal,
  8. bool? isStatic,
})

Implementation

TextStyle small5(
    {Color? color,
    bool? isBold,
    String? pageName,
    TextDecoration? decoration,
    Color? backgroundColor,
    String? fontFamily,
    FontWeight fontWeight = FontWeight.normal,
    bool? isStatic}) {
  color ??= Get.find<AppColors>().textColor;
  late double fontSize;
  if ((isStatic == null &&
          isStaticDefault == null &&
          Get.find<AppSettings>().properties.screenMode ==
              ScreenMode.mobile) ||
      (isStatic == null && isStaticDefault == false) ||
      isStatic == false) {
    double ratio = pageName == null
        ? _sizeRatios["small"]!
        : getPageDynamicFonts(pageName, SizeType.small);
    fontSize = ratio * _totalSize;
  } else {
    fontSize = pageName == null
        ? _staticSizes["small"]!
        : getPageStaticFonts(pageName, SizeType.small);
  }

  return GoogleFonts.getFont(
      fontFamily ??
          (pageName != null
              ? Get.find<PageManager>()
                  .getPageFontFamily(pageName, SizeType.small)
              : defaultFontFamily),
      fontSize: fontSize,
      color: color,
      decoration: decoration,
      backgroundColor: backgroundColor,
      fontWeight: isBold == null
          ? fontWeight
          : isBold
              ? FontWeight.bold
              : FontWeight.normal);
}