setZoomScale method
Set the zoom scale of the camera.
The zoomScale
must be between 0.0 and 1.0 (both inclusive).
If the zoomScale
is out of range,
it is adjusted to fit within the allowed range.
Does nothing if the camera is not running.
Implementation
Future<void> setZoomScale(double zoomScale) async {
_throwIfNotInitialized();
if (!value.isRunning) {
return;
}
final double clampedZoomScale = zoomScale.clamp(0.0, 1.0);
// Update the zoom scale state to the new state.
// When the platform has updated the zoom scale,
// it will send an update through the zoom scale state event stream.
await MobileScannerPlatform.instance.setZoomScale(clampedZoomScale);
}