Future<Null> setPreferredOrientations(List<DeviceOrientation> orientations)

Specifies the set of orientations the application interface can be displayed in.

Arguments:

  • orientation: A list of DeviceOrientation enum values. The empty list is synonymous with having all options enabled.

Source

static Future<Null> setPreferredOrientations(List<DeviceOrientation> orientations) async {
  await PlatformMessages.invokeMethod(
    _kChannelName,
    'SystemChrome.setPreferredOrientations',
    <List<String>>[ _stringify(orientations) ],
  );
}