Common Font Style

PHOTO EMBED

Thu Apr 25 2024 07:51:39 GMT+0000 (Coordinated Universal Time)

Saved by @hey123 #dart #flutter

class fontstyle {
  static FontWeight? Fontweights({FWT fontWeight = FWT.regular}) {
    switch (FWT) {
      case FWT.bold:
        return FontWeight.w700;
      case FWT.semiBold:
        return FontWeight.w600;
      case FWT.medium:
        return FontWeight.w500;
      case FWT.regular:
        return FontWeight.w400;
      case FWT.light:
        return FontWeight.w300;
      default:
        return FontWeight.w400;
    }
  }

  static TextStyle f14(
      {required Color colors, FWT? fontweight, double height = 0.0}) {
    return TextStyle(
        fontSize: 14.sp,
        fontFamily: "Poppins",
        fontWeight: Fontweights(fontWeight: fontweight!),
        color: Colors.amberAccent);
  }

  static TextStyle f12(
      {required Color colors, FWT? fontweight, double height = 0.0}) {
    return TextStyle(
        fontSize: 12.sp,
        fontFamily: "Poppins",
        fontWeight: Fontweights(fontWeight: fontweight!),
        color: Colors.amberAccent);
  }
}
content_copyCOPY