pixelRatio property

double get pixelRatio

Returns the screen's devicePixelRatio. This property retrieves the device's pixel density. A higher value means more pixels per logical pixel. If MediaQuery is unavailable, it defaults to a ratio of 1.0.

Implementation

double get pixelRatio => MediaQuery.maybeOf(this)?.devicePixelRatio ?? 1.0;