Skip to content

Commit

Permalink
Fix: Camera lockCaptureOrientation fix (openfoodfacts#1151)
Browse files Browse the repository at this point in the history
  • Loading branch information
M123-dev authored Feb 18, 2022
1 parent 0bf735d commit 4cdc437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/smooth_app/lib/pages/scan/ml_kit_scan_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ class MLKitScannerPageState extends State<MLKitScannerPage> {
ResolutionPreset.high,
enableAudio: false,
);
_controller?.setFocusMode(FocusMode.auto);
_controller?.lockCaptureOrientation(DeviceOrientation.portraitUp);

// If the controller is initialized update the UI.
_controller?.addListener(() {
Expand All @@ -142,6 +140,8 @@ class MLKitScannerPageState extends State<MLKitScannerPage> {

try {
await _controller?.initialize();
_controller?.setFocusMode(FocusMode.auto);
_controller?.lockCaptureOrientation(DeviceOrientation.portraitUp);
_controller?.startImageStream(_processCameraImage);
} on CameraException catch (e) {
if (kDebugMode) {
Expand Down

0 comments on commit 4cdc437

Please sign in to comment.