getFontSize method

double getFontSize(
  1. BuildContext context, {
  2. double fontSize = 18,
})

Implementation

double getFontSize(BuildContext context, {double fontSize = 18}) {
  TextScaler textScaler = MediaQuery.of(context).textScaler;

  double calculatedFontSize = textScaler.scale(fontSize);

  return calculatedFontSize;
}