class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// This vvvv
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
// ^^^^
return new MaterialApp(...);
}
}