exitFullscreen method

Future<void> exitFullscreen()

Exits fullscreen mode.

Implementation

Future<void> exitFullscreen() async {
  if (isWeb) {
    WebUtils.toggleFullscreen(false);
  } else if (isDesktop) {
    await WindowManager.instance.setFullScreen(false);

    // TODO: Remove when leanflutter/window_manager#131 is fixed:
    //       https://github.com/leanflutter/window_manager/issues/131
    Size size = await WindowManager.instance.getSize();
    await WindowManager.instance.setSize(Size(size.width + 1, size.height));
  } else if (isMobile) {
    await SystemChrome.setEnabledSystemUIMode(
      SystemUiMode.manual,
      overlays: SystemUiOverlay.values,
    );
  }
}