getHeightPx method

double getHeightPx(
  1. double sizePx
)

仅支持纵屏。 returns the size after adaptation according to the screen height.(unit dp or pt) 返回根据屏幕高适配后尺寸(单位 dp or pt) sizePx unit px

Implementation

double getHeightPx(double sizePx) {
  return _screenHeight == 0.0
      ? (sizePx / _designD)
      : (sizePx * _screenHeight / (_designH * _designD));
}