Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Is there a way to make ZoomableWidget's child get tap event #106

Open
hahafather007 opened this issue May 22, 2019 · 1 comment
Open

Is there a way to make ZoomableWidget's child get tap event #106

hahafather007 opened this issue May 22, 2019 · 1 comment
Projects

Comments

@hahafather007
Copy link

Like this:

ZoomableWidget(
      child: Stack(
        children: <Widget>[
          GestureDetector(
            onTap: () {
              debugPrint("onTap!!!");
            },
            child: Container(
              width: 40,
              height: 40,
              color: Colors.blue,
            ),
          ),
        ],
      ),
    )
@hahafather007
Copy link
Author

hahafather007 commented May 22, 2019

I modified the source code to solve the problem, it is recommended to modify the ZoomWidget part of the code like this:

        LayoutId(
          id: _ZoomableWidgetLayout.gestureContainer,
          child: GestureDetector(
            child: Container(),
            onScaleStart: _onScaleStart,
            onScaleUpdate: _onScaleUpdate,
            onScaleEnd: widget.bounceBackBoundary ? _onScaleEnd : null,
            onDoubleTap: _handleDoubleTap,
            onTap: widget.onTap,
            behavior: HitTestBehavior.translucent,
          ),
        ),

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
feature
  
TODO
Development

No branches or pull requests

2 participants