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 mai
Try
void main() async { WidgetsFlutterBinding.ensureInitialized(); await SystemChrome.setPreferredOrientations( [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); runApp(MyApp()); }
You can also change the screen orientation settings in the android manifest and ios info.plist file.