getFontSize static method
Returns Responsive Font Size declared in resources/json/config.json
Implementation
static double getFontSize(BuildContext context, String text,
{double defaulValue = 0}) {
if (isScreen(context, mobileSmall: true)) {
return Field.getDouble(_dimension!.textMobileSmall[text], defaulValue);
}
if (isScreen(context, mobileMedium: true)) {
return Field.getDouble(_dimension!.textMobileMedium[text], defaulValue);
}
if (isScreen(context, mobileLarge: true)) {
return Field.getDouble(_dimension!.textMobileLarge[text], defaulValue);
}
if (isScreen(context, tablet: true)) {
return Field.getDouble(_dimension!.textTablet[text], defaulValue);
}
if (isScreen(context, laptop: true)) {
return Field.getDouble(_dimension!.textLaptop[text], defaulValue);
}
if (isScreen(context, laptopLarge: true)) {
return Field.getDouble(_dimension!.textLaptopLarge[text], defaulValue);
}
return Field.getDouble(_dimension!.textFourK[text], defaulValue);
}