calculateBoxFitRatio function

  1. @Deprecated('Use ScanWindowUtils.calculateBoxFitRatio instead.')
({double heightRatio, double widthRatio}) calculateBoxFitRatio(
  1. BoxFit boxFit,
  2. Size cameraPreviewSize,
  3. Size size
)

Calculate the scaling ratios for width and height to fit the provided cameraPreviewSize into the specified size, based on the specified boxFit.

Returns a record containing the width and height scaling ratios.

Implementation

@Deprecated('Use ScanWindowUtils.calculateBoxFitRatio instead.')
({double widthRatio, double heightRatio}) calculateBoxFitRatio(
  BoxFit boxFit,
  Size cameraPreviewSize,
  Size size,
) {
  // TODO(navaronbracke): remove the deprecated method in the next release
  return ScanWindowUtils.calculateBoxFitRatio(
    boxFit: boxFit,
    cameraPreviewSize: cameraPreviewSize,
    size: size,
  );
}