setPreferredOrientationLandscape static method
To use this function make sure to call WidgetsFlutterBinding.ensureInitialized(); in your main() function
Implementation
static Future<void> setPreferredOrientationLandscape() =>
setPreferredOrientations(
[DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);