'My app in landscape When i back my flutter webview

I have created Flutter Webview for the game. game is working on landscape mood. Webview also shows landscape but when I back the Webview app also showed in landscape mood

tt



Solution 1:[1]

Its because you are not changing the system view after the game screen. Try anyone of the following,

1.Add this in the .then(){} call back of the navigation call to the gmescreen,

   SystemChrome.setPreferredOrientations([
      DeviceOrientation.landscapeRight,
      DeviceOrientation.landscapeLeft,
      DeviceOrientation.portraitUp,
      DeviceOrientation.portraitDown,
     ]);

OR

2.Add this at the dispose method of game screen,

  @override
  void dispose() {
    SystemChrome.setPreferredOrientations([
      DeviceOrientation.landscapeRight,
      DeviceOrientation.landscapeLeft,
      DeviceOrientation.portraitUp,
      DeviceOrientation.portraitDown,
    ]);
    super.dispose();
  }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fahmida