configureViewport method

void configureViewport({
  1. required double width,
  2. required double height,
  3. double devicePixelRatio = 1.0,
})

Configures the logical viewport size and backing-store scale.

Implementation

void configureViewport({
  required double width,
  required double height,
  double devicePixelRatio = 1.0,
}) {
  _viewportWidth = width > 0 ? width : 1;
  _viewportHeight = height > 0 ? height : 1;
  _devicePixelRatio = devicePixelRatio > 0 ? devicePixelRatio : 1.0;
}