setExposurePoint method

Future<void> setExposurePoint(
  1. Offset? point
)

Sets the exposure point for automatically determining the exposure value.

Supplying a null value will reset the exposure point to it's default value.

Implementation

Future<void> setExposurePoint(Offset? point) async {
  if (point != null &&
      (point.dx < 0 || point.dx > 1 || point.dy < 0 || point.dy > 1)) {
    throw ArgumentError(
        'The values of point should be anywhere between (0,0) and (1,1).');
  }

  try {
    await CameraPlatform.instance.setExposurePoint(
      _cameraId,
      point == null
          ? null
          : Point<double>(
              point.dx,
              point.dy,
            ),
    );
  } on PlatformException catch (e) {
    throw CameraException(e.code, e.message);
  }
}