setExposureOffset method

  1. @override
Future<double> setExposureOffset(
  1. int cameraId,
  2. double offset
)

Sets the exposure offset for the selected camera.

The supplied offset value should be in EV units. 1 EV unit represents a doubling in brightness. It should be between the minimum and maximum offsets obtained through getMinExposureOffset and getMaxExposureOffset respectively. Throws a CameraException when an illegal offset is supplied.

When the supplied offset value does not align with the step size obtained through getExposureStepSize, it will automatically be rounded to the nearest step.

Returns the (rounded) offset value that was set.

Implementation

@override
Future<double> setExposureOffset(int cameraId, double offset) async {
  final double? appliedOffset = await _channel.invokeMethod<double>(
    'setExposureOffset',
    <String, dynamic>{
      'cameraId': cameraId,
      'offset': offset,
    },
  );

  return appliedOffset!;
}