lock static method

void lock(
  1. DeviceOrientation orientation
)

Implementation

static void lock(DeviceOrientation orientation) {
  if (orientation == DeviceOrientation.landscapeLeft && Platform.isIOS) {
    orientation = DeviceOrientation.landscapeRight;
  }
  SystemChrome.setPreferredOrientations([orientation]);
}