getMaxZoomFactor method

Future<double> getMaxZoomFactor()

Retrieves the maximum available zoom factor for the device's camera.

Returns a Future that completes with the maximum zoom factor.

Example usage:

double maxZoom = await getMaxZoomFactor();
print('Maximum zoom factor: $maxZoom');

Implementation

Future<double> getMaxZoomFactor() {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel
      .invokeMethod('getMaxZoomFactor')
      .then((zoomFactor) => zoomFactor as double);
}