简体   繁体   English

Flutter web:当应用程序安装到主屏幕时,如何修复在 IOS 中向后滑动时的白页

[英]Flutter web: how to fix white page on swipe back in IOS when app is installed to home screen

If I swipe back from a very first page of any flutter app installed to home screen from Safari I receive a blank page:如果我从 Safari 安装到主屏幕的任何 flutter 应用程序的第一页向后滑动,我会收到一个空白页面:

the swiping process picture刷卡过程图

It goes back automatically to the first page in three seconds and doesn't appear anymore until the app is reloaded.它会在三秒钟内自动返回到第一页,并且在重新加载应用程序之前不会再出现。 I used a sample flutter app without any changes to reproduce this behavior.我使用了示例 flutter 应用程序,没有任何更改来重现此行为。

What I've tried to fix this:我试图解决这个问题:

  1. WillPopScope as suggested here , but it's only useful in Safari tab and doesn't have any effect on a home screen app. WillPopScope建议但它仅在 Safari 选项卡中有用,对主屏幕应用程序没有任何影响。 I tried to wrap Scaffold of a home widget and the whole app just to check.我试图包装一个家庭小部件的Scaffold和整个应用程序只是为了检查。
  2. Any tricks with Navigator weren't helpful. Navigator的任何技巧都没有帮助。 If I try to pop anything from a home page like this:如果我尝试从这样的主页弹出任何内容:
    Navigator.of(context).pop();
    Navigator.pushReplacement(context,
        new MaterialPageRoute(builder: (context) => MyHomePage()));

, i (obviously) receive an error: Navigator has no active routes to replace. ,我(显然)收到一个错误: Navigator has no active routes to replace.

  1. I also tried to use the fullscreenDialog: true parameter in MaterialPageRoute when navigated to the next page but the blank page on swipe back remains.我还尝试在导航到下一页时在MaterialPageRoute中使用fullscreenDialog: true参数,但向后滑动时空白页面仍然存在。

How to get rid of this behavior properly?如何正确摆脱这种行为?

I am having the same problem and I believe this has not been solved yet.我有同样的问题,我相信这还没有解决。 Looks to be tracked by this (and related) issue: https://github.com/flutter/flutter/issues/76478看起来被这个(和相关的)问题跟踪: https://github.com/flutter/flutter/issues/76478

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何删除iOS上HTML5 Web应用程序中闪屏和第一页之间出现的白页 - How to remove white page that appears between splash screen and first page on HTML5 web app on iOS 从iOS 7主屏幕启动时,Web应用程序JS未运行 - Web app JS not running when launched from iOS 7 home screen 将HTML5 Web应用程序添加到iOS的主屏幕时未缓存 - HTML5 web app not caching when added to home screen on iOS HTML5网络应用程序在iOS中添加到主屏幕时不缓存 - HTML5 web app not caching when added to home screen in iOS 全屏显示时,主屏幕网络应用会切断部分页面 - home screen web app cuts off part of the page when fullscreen IOS怎么改回flutter? - How to change IOS swipe back flutter? 当应用程序在 iOS 中崩溃时如何将应用程序带到应用程序主屏幕 - How to bring App to App Home screen when app crashes in iOS iOS主屏幕滑动功能 - iOS home screen swipe functionality 在从主屏幕打开的 web 应用程序中,如何在 iOS 中设置不同的样式? - How can I style something differently in iOS when in a web app opened from the home screen? Flutter Web - 手机上的白屏/空白页 iOS 版本的 Z2567A5EC9705EB7AC2C98403DE06 - Flutter Web - white screen / blank page on mobile iOS version of web application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM