When I run the example below, the instance of WebView
(from webview_flutter
plugin) never calls onTap
, no matter which URL I'm on.
Because gestureRecognizers
override the widget's gestures, I'd assume that onTap
should be called whenever there is a tap anywhere in my webview - I'm I assuming something wrong here?
Future<void> main() async {
runApp(WebViewBug());
}
class WebViewBug extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: WebView(
initialUrl: 'https://google.com',
javascriptMode: JavascriptMode.unrestricted,
gestureRecognizers: {
Factory<TapGestureRecognizer>(() => TapGestureRecognizer()
..onTap = () {
print('didTap');
}),
},
),
),
);
}
}
Flutter version used is 2.5.2
.