setFocusMode method
Set the focus mode of the device.
supportedFocusModes should be called before this.
Implementation
@override
Future<void> setFocusMode(FocusMode mode) {
verifyInitialized();
verifyNotDisposed();
switch (mode) {
case FocusMode.fixed:
cameraParameters.setFocusMode(CameraParameters.focusModeFixed);
break;
case FocusMode.continuousImageAutoFocus:
cameraParameters.setFocusMode(
CameraParameters.focusModeContinuousPicture,
);
break;
case FocusMode.continuousVideoAutoFocus:
cameraParameters.setFocusMode(
CameraParameters.focusModeContinuousVideo,
);
break;
}
return camera.setParameters(cameraParameters);
}