GestureDetector allow to pass event to child

Viewed 43

I have a WebView wrapped in a GestureDetector like below.

GestureDetector(
      behavior: HitTestBehavior.translucent,
      onHorizontalDragEnd: (dragEndDetails) {
        if (dragEndDetails.primaryVelocity! < 0) {
          // Something happens
        } else if (dragEndDetails.primaryVelocity! > 0) {
          // Something else happens
        }
      },
      child: Center(
        child: WebView(
            initialUrl: "example.com",
            onWebViewCreated: (WebViewController webViewController) {
                // Whatever
            },
        );,
      ),
    )

Is there a way so that events in both the GestureDetector and the child will be triggered instead of in the GestureDetector only ?

For instance, if I remove the onHorizontalDragEnd handler, the user can resize an image in the underlying webView but that's not the case if the handler is present.

0 Answers
Related