[Web] Web app inside WebView is not responding after halfway swiping back gesture on iOS
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
1. Create a web application with three pages
2. Create a native application and use the web_view plug-in to open the web application
3. Enter the web page, slide sideways to return, and then cancel the return
### Expected results
The page is normal
### Actual results
ANR
### Code sample
Code sample
```dart
final GoRouter _router = GoRouter(
initialLocation: '/',
routes: [
GoRoute(
path: '/',
builder: (BuildContext context, GoRouterState state) {
return const MyHomePage();
},
),
GoRoute(
path: 'list',
builder: (BuildContext context, GoRouterState state) {
return const ListPage();
},
),
GoRoute(
path: 'detail',
builder: (BuildContext context, GoRouterState state) {
return const ListPage();
},
),
],
);
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: _router,
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State createState() => _MyHomePageState();
}
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text('Flutter Web Home Page'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(onPressed: (){
Navigator.of(context).push(MaterialPageRoute(builder: (c)=> const ListPage()));
}, child: Text('open web')),
],
),
),
);
}
}
```
### Screenshots or Video
Screenshots / Video demonstration
https://github.com/user-attachments/assets/0da16172-0aeb-4cdc-8ae6-088190d99a56
### Logs
_No response_
### Flutter Doctor output
Doctor output
```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] 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 (5 available)
[✓] Network resources
• No issues found!
```
```console
webview_flutter: 4.1.0
```
Contributor guide
Assessment
This issue has not been assessed yet.