setPreferredOrientations method

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

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

The orientation argument is a list of DeviceOrientation enum values. The empty list causes the application to defer to the operating system default.

Implementation

static Future<void> setPreferredOrientations(List<DeviceOrientation> orientations) async {
  await SystemChannels.platform.invokeMethod(
    'SystemChrome.setPreferredOrientations',
    _stringify(orientations),
  );
}