I want my flutter web app to run in landscape mode.
Till now I have tried to add the following line in my main.dart
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
But I think the above code works for only the android or ios apps.
I have also set the orientation to landscape in my manifest.json file:-
"orientation": "landscape",
If anyone can tell me any way to do this in flutter or even by using JavaScript then also it will work.
Import import 'package:flutter/services.dart';
then put these lines of code in main dart and main method.
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitDown,
DeviceOrientation.portraitUp,
]);
runApp(myApp());