setFullScreenOverlaysAndOrientations method

Future<void> setFullScreenOverlaysAndOrientations({
  1. dynamic hideOverLays = true,
})

hide the statusBar and the navigation bar, set only landscape mode only if forceLandScapeInFullscreen is true

Implementation

Future<void> setFullScreenOverlaysAndOrientations({
  hideOverLays = true,
}) async {
  await SystemChrome.setPreferredOrientations(this.forceLandScapeInFullscreen
      ? [
          DeviceOrientation.landscapeLeft,
          DeviceOrientation.landscapeRight,
        ]
      : this.orientations);

  if (hideOverLays) {
    await SystemChrome.setEnabledSystemUIOverlays([]);
  }
}