devicePixelRatio property
override
The device pixel ratio to use for this test.
Defaults to the value provided by Display.devicePixelRatio. This can only be set in a test environment to emulate different display configurations. A standard Display is not mutable from the framework.
See also:
- Display.devicePixelRatio for the standard implementation
- TestFlutterView.devicePixelRatio which will stay in sync with this value
- resetDevicePixelRatio to reset this value specifically
- reset to reset all test values for this display
Implementation
@override
double get devicePixelRatio => _devicePixelRatio ?? _display.devicePixelRatio;
Implementation
set devicePixelRatio(double value) {
_devicePixelRatio = value;
_platformDispatcher.onMetricsChanged?.call();
}