getPixelDensity static method

double getPixelDensity()

Retrieves the pixel density or device pixel ratio.

Returns a double representing the pixel density.

Example:

double pixelDensity = EaseDevice.getPixelDensity();

Implementation

static double getPixelDensity() {
  return MediaQuery.of(Utils.globalKey.currentContext!).devicePixelRatio;
}