当我支持Flutter Webview时,我的应用程序在景观中

发布于 2025-01-20 10:36:22 字数 216 浏览 0 评论 0原文

我为游戏创建了 Flutter Webview。游戏正在研究景观情绪。 Webview 也显示横向,但当我返回时,Webview 应用程序也显示横向心情

tt

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

燕归巢 2025-01-27 10:36:22

它是因为您在游戏屏幕之后没有更改系统视图。
尝试以下任何人,

1.将导航呼叫的回电回到GMESCREEN

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

或2.

在游戏屏幕的dispose方法中添加到.2.添加。

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

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();
  }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文