devicePixelRatio property Null safety

num devicePixelRatio
final

The device pixel ratio is the ratio between physical pixels and logical pixels.

For instance, the iPhone 4 and iPhone 4S reports a device pixel ratio of 2, because the physical linear resolution is double the logical resolution. The iPhone 6 reports a device pixel ratio of 3. Some devices may even report a device pixel ratio of 1.325 (Nexus 7 v1).

Implementation

final num devicePixelRatio = env.devicePixelRatio;