toggleFullScreenMode method

void toggleFullScreenMode()

Implementation

void toggleFullScreenMode() {
  var fs = value.isFullScreen;
  updateValue(value.copyWith(isFullScreen: !fs));
  if (!fs) {
    SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
        overlays: [SystemUiOverlay.top]);
    SystemChrome.setPreferredOrientations([
      DeviceOrientation.landscapeLeft,
      DeviceOrientation.landscapeRight,
    ]);
  } else {
    SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
  }
}