We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38e315b commit 29f5536Copy full SHA for 29f5536
lib/src/webview_scaffold.dart
@@ -79,8 +79,14 @@ class _WebviewScaffoldState extends State<WebviewScaffold> {
79
_onBack = webviewReference.onBack.listen((_) async {
80
if (!mounted) return;
81
82
- if (await Navigator.maybePop(context)) {
+ // Equivalent of Navigator.maybePop(), except that [webviewReference]
83
+ // is closed when the pop goes ahead. Whether the pop was performed
84
+ // can't be determined from the return value of Navigator.maybePop().
85
+ final route = ModalRoute.of(context);
86
+ final pop = await route?.willPop();
87
+ if (pop == RoutePopDisposition.pop) {
88
webviewReference.close();
89
+ Navigator.pop(context);
90
}
91
});
92
0 commit comments