From 4cdc437a41985af31d95569142968fb396d7e89d Mon Sep 17 00:00:00 2001 From: Marvin M <39344769+M123-dev@users.noreply.github.com> Date: Fri, 18 Feb 2022 19:52:08 +0100 Subject: [PATCH] Fix: Camera lockCaptureOrientation fix (#1151) --- packages/smooth_app/lib/pages/scan/ml_kit_scan_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/smooth_app/lib/pages/scan/ml_kit_scan_page.dart b/packages/smooth_app/lib/pages/scan/ml_kit_scan_page.dart index 1596447dd8c..da5c74014e0 100644 --- a/packages/smooth_app/lib/pages/scan/ml_kit_scan_page.dart +++ b/packages/smooth_app/lib/pages/scan/ml_kit_scan_page.dart @@ -126,8 +126,6 @@ class MLKitScannerPageState extends State { ResolutionPreset.high, enableAudio: false, ); - _controller?.setFocusMode(FocusMode.auto); - _controller?.lockCaptureOrientation(DeviceOrientation.portraitUp); // If the controller is initialized update the UI. _controller?.addListener(() { @@ -142,6 +140,8 @@ class MLKitScannerPageState extends State { try { await _controller?.initialize(); + _controller?.setFocusMode(FocusMode.auto); + _controller?.lockCaptureOrientation(DeviceOrientation.portraitUp); _controller?.startImageStream(_processCameraImage); } on CameraException catch (e) { if (kDebugMode) {