switchToLandscape static method

Future<void> switchToLandscape()

切换到横屏模式

Implementation

static Future<void> switchToLandscape() async {
  await SystemChrome.setPreferredOrientations([
    DeviceOrientation.landscapeLeft, // 左横屏
    DeviceOrientation.landscapeRight, // 右横屏
  ]);
}