exitFullScreen static method

Future<void> exitFullScreen()

退出全屏模式

Implementation

static Future<void> exitFullScreen() async {
  // 如果已经不是全屏模式,则直接返回
  if (!isFullScreen()) return;

  // 恢复状态栏和导航栏
  await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);

  // 解锁屏幕方向,恢复为竖屏
  await OrientationUtil.switchToPortrait();
}