There is a GestureDetector above the WebView.
when I touch the GestureDetector, the WebView is also response touch event.
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
WebView(
initialUrl: url,
javascriptMode: JavascriptMode.unrestricted
),
GestureDetector(
child:Image.asset('.....'),
onTap:(){
//do something
}
)
],
),
);
}
How Can I stop WebView's touch response when I tap the GestureDetector?
I thhink this is what you need. AbsorbPointer is absorbing all the touches and doesn't allow WebView to get them.
Stack(
children: <Widget>[
AbsorbPointer(
child: WebView(
initialUrl: url,
javascriptMode: JavascriptMode.unrestricted
),
),
GestureDetector(
child:Image.asset('.....'),
onTap:(){
//do something
}
)
],
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With