diff --git a/lib/src/states/camera_picker_state.dart b/lib/src/states/camera_picker_state.dart index c955fe2..a181276 100644 --- a/lib/src/states/camera_picker_state.dart +++ b/lib/src/states/camera_picker_state.dart @@ -945,15 +945,19 @@ class CameraPickerState extends State } wrapControllerMethod( 'setFocusMode', - () => controller.setFocusMode(FocusMode.auto), + () async { + await innerController?.setFocusMode(FocusMode.auto); + }, ); if (previousExposureMode != ExposureMode.locked) { wrapControllerMethod( 'setExposureMode', - () => controller.setExposureMode(previousExposureMode), + () async { + await innerController?.setExposureMode(previousExposureMode); + }, ); } - await controller.resumePreview(); + await innerController?.resumePreview(); } catch (e, s) { handleErrorWithHandler(e, s, pickerConfig.onError); } finally { @@ -1071,13 +1075,13 @@ class CameraPickerState extends State ); if (entity != null) { if (pickerConfig.onPickConfirmed case final onPickConfirmed?) { - await controller.resumePreview(); + await innerController?.resumePreview(); onPickConfirmed(entity); } else { Navigator.of(context).pop(entity); } } else { - await controller.resumePreview(); + await innerController?.resumePreview(); } } catch (e, s) { recordCountdownTimer?.cancel();