i am using foo.com as in flutter webview 4, when i go to foo.com/about it does not go back, popScope apears, how to prevent pop scope if i am on foo.com/about
this is my build method
Widget build(BuildContext context) {
controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0x00000000))
..setNavigationDelegate(
NavigationDelegate(
onNavigationRequest: (NavigationRequest request) async {
print(request);
if (request.url.startsWith('https://www.youtube.com/')) {
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
onPageFinished: (url) {
controller.runJavaScript(
"document.getElementsByClassName('logo me-lg-4')[0].style.display='none';");
controller.runJavaScript(
"document.getElementsByClassName('tawk-min-container')[0].style.display='none';");
controller.runJavaScript(
"document.getElementsByClassName('scrollToTop active')[0].style.display='none';");
},
),
)
..loadRequest(Uri.parse('https://auctionwind.com'));
return SafeArea(
child: Scaffold(
body: WebViewWidget(
controller: controller,
),
),
);
}
and this is my popscope (in another dart file)
return PopScope(
canPop: false,
onPopInvoked: (didpop) async {
if (didpop) {
return;
}
final bool shouldPop = await onback(context);
if (shouldPop) {
SystemNavigator.pop();
}
},
child: Scaffold()