setOrientationPortrait method Null safety

Future<bool> setOrientationPortrait()

Only works on Android and iOS

Implementation

static Future<bool> setOrientationPortrait() async {
  if (isDesktop()) return Future.value();
  // ios crash Supported orientations has no common orientation with the application
  bool? changed = await _channel.invokeMethod("setOrientationPortrait");
  SystemChrome.setPreferredOrientations(
      [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
  return Future.value(changed);
}