flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.69k stars 27.36k forks source link

The first page returns to a blank page for flutter web #157502

Closed StanleyCocos closed 2 hours ago

StanleyCocos commented 2 hours ago

Steps to reproduce

  1. Create a blank project
  2. Run into Google browser
  3. Run webview_flutter example a. Requires iOS device b. setAllowsBackForwardNavigationGestures(true) must be turned on
  4. Swipe sideways from the homepage

Expected results

No gesture navigation (back)

Actual results

back to blank page

Code sample

Code sample ```dart if (controller.platform is WebKitWebViewController) { (controller.platform as WebKitWebViewController) .setAllowsBackForwardNavigationGestures(true); } ``` ```html
```

Screenshots or Video

Screenshots / Video demonstration https://github.com/user-attachments/assets/8249c588-8be2-4399-bd13-62e8cd88c10f

Logs

Logs ```console ```

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.24.3, on macOS 14.0 23A344 darwin-arm64 (Rosetta), locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.2) [✓] VS Code (version 1.94.2) [✓] Connected device (6 available) [✓] Network resources • No issues found! ```
StanleyCocos commented 2 hours ago

I have verified many times that calling canGoBack on the home page is true. This problem exists even in iOS native wkwebview. My guess is that converting flutter to html creates an extra layer of pages.

danagbemava-nc commented 2 hours ago

Hi @StanleyCocos, this is a known issue which is being tracked in https://github.com/flutter/flutter/issues/99755

Kindly follow up in the original issue for updates

Closing from here

Thank you