getPxFromDesignPx static method

int getPxFromDesignPx(
  1. int designPx
)

Implementation

static int getPxFromDesignPx(int designPx) {
  MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
  final size = mediaQuery.size * mediaQuery.devicePixelRatio;
//    L.e(size.width.toString());
  int res = ((size.width * designPx) / 750).toInt();

  return res;
}