setOrientationPortrait static method
Only works on Android and iOS
Implementation
static Future<bool> setOrientationPortrait() async {
if (isDesktop()) return Future<bool>.value(true);
// ios crash Supported orientations has no common orientation with the application
bool? changed = await FplayerPlatform.instance.setOrientationPortrait();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
return Future.value(changed ?? false);
}