flutter-textstyle-extensions
flutter-textstyle-extensions copied to clipboard
Google fonts Font weight not working
@Devbrail You can do it like this:
class Fonts {
static TextStyle interNormal({
FontWeight? weight = FontWeight.normal
}) {
return GoogleFonts.inter(
fontSize: 12,
fontStyle: FontStyle.normal,
fontWeight: weight,
);
}
static TextStyle get inter {
return interNormal();
}
static TextStyle get interMedium {
return interNormal(weight: FontWeight.w500);
}
static TextStyle get interBold {
return interNormal(weight: FontWeight.bold);
}
}
Usage:
style: Fonts.interBold.size(24)