setZoomLevel method

  1. @override
Future<void> setZoomLevel(
  1. int cameraId,
  2. double zoom
)

Set the zoom level for the selected camera.

The supplied zoom value should be between the minimum and the maximum supported zoom level returned by getMinZoomLevel and getMaxZoomLevel. Throws a CameraException when an illegal zoom level is supplied.

Implementation

@override
Future<void> setZoomLevel(int cameraId, double zoom) async {
  try {
    await _channel.invokeMethod<double>(
      'setZoomLevel',
      <String, dynamic>{
        'cameraId': cameraId,
        'zoom': zoom,
      },
    );
  } on PlatformException catch (e) {
    throw CameraException(e.code, e.message);
  }
}