roundToNearestPixel(layoutSize) {
    const ratio = PixelRatio.get();
    return Math.round(layoutSize * ratio) / ratio;
  }
Rounds a layout size (dp) to the nearest layout size that corresponds to
an integer number of pixels. For example, on a device with a PixelRatio
of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to
exactly (8.33 * 3) = 25 pixels.