percentFontSize static method

double percentFontSize(
  1. double size
)

Returns scaled font size based on screen size and density.

Implementation

static double percentFontSize(double size) {
  _assertInitialized();
  assert(size > 0, 'Font size must be greater than zero.');
  final scaled =
      ((percentHeight(size) + percentWidth(size)) +
          (pixelRatio * aspectRatio)) /
      2.08 /
      100;
  return size * scaled;
}