在下面的代码中,只有WebViewWidget注册了tap,而onTap从来没有被调用过,我做错了什么?
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () => resetInactivityTimer(),
child: WebViewWidget(
controller: _webViewController,
),
),
);
}```
Thank you in advance
I tried combinations of both but never achieved the goal
1条答案
按热度按时间tsm1rwdh1#
尝试使用此包:https://pub.dev/packages/pointer_interceptor,显然这解决了它(如https://github.com/flutter/flutter/issues/58659所述)