I want to set orientation portrait only for small screen devices. At the moment I set everything to portrait orientation like so:
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
runApp(MyApp());
}
How can I set portrait orientation only if screen width is below a certain pixel count? (eg: 500px)
Thanks