From 77ff7a3f0bf0350201993da08d9b173e5136ffbd Mon Sep 17 00:00:00 2001 From: Raman Rasliuk Date: Mon, 13 Jul 2020 17:51:48 +0200 Subject: [PATCH] Update qr_bar_scanner_camera.dart --- lib/qr_bar_scanner_camera.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/qr_bar_scanner_camera.dart b/lib/qr_bar_scanner_camera.dart index 67445dd..548f4cc 100644 --- a/lib/qr_bar_scanner_camera.dart +++ b/lib/qr_bar_scanner_camera.dart @@ -188,23 +188,23 @@ class Preview extends StatelessWidget { builder: (context) { var nativeOrientation = NativeDeviceOrientationReader.orientation(context); + frameWidth = width; + frameHeight = height; + int baseOrientation = 0; if (orientation != 0 && (width > height)) { baseOrientation = orientation ~/ 90; frameHeight = height; frameWidth = width; - } else { - frameWidth = height; - frameHeight = width; } int nativeOrientationInt; switch (nativeOrientation) { case NativeDeviceOrientation.landscapeLeft: - nativeOrientationInt = Platform.isAndroid ? 3 : 1; + nativeOrientationInt = 3; break; case NativeDeviceOrientation.landscapeRight: - nativeOrientationInt = Platform.isAndroid ? 1 : 3; + nativeOrientationInt = 1; break; case NativeDeviceOrientation.portraitDown: nativeOrientationInt = 2;