简体   繁体   中英

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:

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.

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. I tried to wrap Scaffold of a home widget and the whole app just to check.
  2. Any tricks with Navigator weren't helpful. 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.

  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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM