mintware-de / flutter_barcode_reader

A flutter plugin for reading 2D barcodes and QR codes.
MIT License
628 stars 463 forks source link

Rotation lock doesn't work #149

Closed cristianfb1989 closed 4 years ago

cristianfb1989 commented 4 years ago

Hello everyone, I tell you to configure the necessary codes to block but even so, to change the position of the cell phone, the camera does the rotation. Can someone help me?

android\app\src\main\AndroidManifest.xml <activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize" android:screenOrientation="portrait">

lib\main.dart void main() { SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, ]); runApp(MyApp()); }

plugins\flutter_barcode_reader-master\android\src\main\AndroidManifest.xml `

`

plugins\flutter_barcode_reader-master\ example \android\app\src\main\AndroidManifest.xml

<activity
            android:name="com.apptreesoftware.barcodescanexample.MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize"
            android:screenOrientation="portrait"
            >

plugins\flutter_barcode_reader-master\ example \lib\main.dart

void main() {
  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
  runApp(new MyApp());
}

Screenshot_1568895635

BharatsDruv commented 4 years ago

// wait until setPreferredOrientations is done and start the app // this works. void main() { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) .then((_) { runApp(new MyApp()); }); }

cristianfb1989 commented 4 years ago

@BharatsDruv Thank you very much!