pixelRatios property

List<double> pixelRatios
getter/setter pair

The available pixel ratios for images on HiDPI displays.

The loader automatically detects the device's display pixel ratio and accordingly loads high resolution images. The application has to provide images with the following naming schema:

1.00x resolution files are named "{imageName}@1.00x.png" 1.25x resolution files are named "{imageName}@1.25x.png" 1.50x resolution files are named "{imageName}@1.50x.png" 2.00x resolution files are named "{imageName}@2.00x.png" 3.00x resolution files are named "{imageName}@3.00x.png"

The default ist 1.0, 2.0. Therefore the application has to provide images with the @1.00x and @2.00x suffix (or images with no name suffix to ignore this feature entirely).

var resourceManager = new ResourceManager();
resourceManager.addBitmapData("test", "images/test@1.00x.png");

Implementation

List<double> pixelRatios = <double>[1, 2];