Can we do this in flutter in the webview that clicking is disabled but scrolling is still enable , can anyone help me with this ??
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: AppColors.appbarColor,
title: Text('Terms of Service'),
),
body: GestureDetector(
onVerticalDragUpdate: (details) {},
onVerticalDragStart: (details) {},
onVerticalDragEnd: (details) {},
child: AbsorbPointer(
absorbing: true,
child: WebViewWidget(
controller: _controller
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {},
onPageStarted: (String url) {},
onPageFinished: (String url) {},
onHttpError: (HttpResponseError error) {},
onWebResourceError: (WebResourceError error) {},
onNavigationRequest: (NavigationRequest request) {
if (request.url.startsWith('https://www.youtube.com/')) {
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
),
),
),
),
),
);
}
I have tried this but both clicking and scrolling disabled
4