Flutter: how to prevent device orientation changes and force portrait?

I would like to prevent my application from changing its orientation and force the layout to stick to “portrait”. In the main.dart, I put: void main(){ SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown ]); runApp(new MyApp()); } but when I use the Android Simulator rotate buttons, the layout “follows” the new device orientation… How could I solve this? Thanks … Read more

Force “portrait” orientation mode

I’m trying to force the “portrait” mode for my application because my application is absolutely not designed for the “landscape” mode. After reading some forums, I added these lines in my manifest file: <application android:debuggable=”true” android:icon=”@drawable/icon” android:label=”@string/app_name” android:screenOrientation=”portrait”> But it doesn’t work on my device (HTC Desire). It switches from “portrait” lo “landscape”, ignoring the … Read more