getScaleSp static method

double getScaleSp(
  1. BuildContext context,
  2. double fontSize
)

仅支持纵屏。 returns the font size after adaptation according to the screen density. 返回根据屏幕宽适配后字体尺寸 fontSize 字体尺寸

Implementation

static double getScaleSp(BuildContext context, double fontSize) {
  if (getScreenW(context) == 0.0) return fontSize;
  return fontSize * getScreenW(context) / _designW;
}