flutter GestureDetector中的WebViewWidget,不注册点击

3phpmpom  于 2023-04-22  发布在  Flutter
关注(0)|答案(1)|浏览(125)

在下面的代码中,只有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

相关问题