focusOnPoint method

Future<void> focusOnPoint(
  1. PreviewSize arg_previewSize,
  2. double arg_x,
  3. double arg_y,
  4. AndroidFocusSettings? arg_androidFocusSettings,
)

Starts auto focus on a point at (x, y).

On Android, you can control after how much time you want to switch back to passive focus mode with androidFocusSettings.

Implementation

Future<void> focusOnPoint(PreviewSize arg_previewSize, double arg_x,
    double arg_y, AndroidFocusSettings? arg_androidFocusSettings) async {
  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
      'dev.flutter.pigeon.CameraInterface.focusOnPoint', codec,
      binaryMessenger: _binaryMessenger);
  final List<Object?>? replyList = await channel.send(
          <Object?>[arg_previewSize, arg_x, arg_y, arg_androidFocusSettings])
      as List<Object?>?;
  if (replyList == null) {
    throw PlatformException(
      code: 'channel-error',
      message: 'Unable to establish connection on channel.',
    );
  } else if (replyList.length > 1) {
    throw PlatformException(
      code: replyList[0]! as String,
      message: replyList[1] as String?,
      details: replyList[2],
    );
  } else {
    return;
  }
}