setPinchToZoomEnabled method

Future<void> setPinchToZoomEnabled(
  1. bool enabled
)

Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning.

enabled: A boolean indicating whether to enable pinch to zoom.

Example usage:

bool pinchToZoomEnabled = true;
_barkoder.setPinchToZoomEnabled(pinchToZoomEnabled);
print('Pinch to zoom enabled: $pinchToZoomEnabled');

Implementation

Future<void> setPinchToZoomEnabled(bool enabled) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod('setPinchToZoomEnabled', enabled);
}