getWidthPx method

double getWidthPx(
  1. double sizePx
)

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

Implementation

double getWidthPx(double sizePx) {
  return _screenWidth == 0.0
      ? (sizePx / _designD)
      : (sizePx * _screenWidth / (_designW * _designD));
}