Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zooming should have priority over changing pages #4

Open
tkortekaas opened this issue May 28, 2021 · 5 comments
Open

Zooming should have priority over changing pages #4

tkortekaas opened this issue May 28, 2021 · 5 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@tkortekaas
Copy link

First of all great job on this plugin. I am the developer of a similar plugin called pinch_zoom, but I was always struggling with some issues that this plugin doesn't have. Only one issue that my plugin managed to solve by using the InteractiveViewer, this plugin still has. Hopefully you might know a solution to this.

Describe the bug
When zooming in on an image in a PageView, the page will change instead of the image zooming in. Possibly this could be resolved using the OneSequenceGestureRecognizer or MultiDragGestureRecognizer.
In my plugin I managed to solve this even more when using the answer provided in https://stackoverflow.com/questions/51712287/how-to-disable-multi-touch-in-mobile-application-using-flutter/56037327#56037327, which I had to use since I couldn't solve the issue using GestureRecognizer solutions, simply since my plugin uses the InteractiveViewer and not that one.

To Reproduce
Steps to reproduce the behavior:

  1. Add a PageView.builder() with multiple pages
  2. Add an image wrapped by the ZoomOverlay() to one of these pages
  3. Try zooming in on this image. Try with both more vertical and horizontal zooming.
  4. Though it works better with twoTouchOnly, you shall notice that the PageView tends to have priority over the zooming of the ZoomOverlay(). It also works better when zooming vertically.

Expected behavior
The image will zoom in instead of the page changing

@tkortekaas tkortekaas added the bug Something isn't working label May 28, 2021
@Mayb3Nots Mayb3Nots added the good first issue Good for newcomers label May 28, 2021
@Mayb3Nots
Copy link
Owner

I have tried to reproduce it but it seems okay when zooming.

Screen_Recording_20210528-203151.mp4

@sooxt98
Copy link

sooxt98 commented May 29, 2021

@Mayb3Nots You are using ListView, the bug he encounter is within PageView ... I think you should

This enhancement might solve this issue, disable all existing touch event when 2 finger tapped on the Image
#5

@Mayb3Nots
Copy link
Owner

@Mayb3Nots You are using ListView, the bug he encounter is within PageView ... I think you should

This enhancement might solve this issue, disable all existing touch event when 2 finger tapped on the Image
#5

The video I showed you was using PageView. Can you guys provide a simple reproduction code

@tkortekaas
Copy link
Author

The following code contains the problem that I tried showing + another weird behaviour. I was about to already file a new report on this, namely that the overlay entry doesn't spawn in the correct place when it is in an expanded widget.

You can't see that in the video, but I constantly tried zooming in with different angles using 2 fingers.

return Scaffold(
      appBar: AppBar(),
      body: PageView(
        children: [
          Container(
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.height,
            color: Colors.blue,
          ),
          Column(
            children: [
              Expanded(
                child: ZoomOverlay(
                  child: Image.network('http://placekitten.com/g/300/200'),
                ),
              ),
            ],
          ),
          Container(
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.height,
            color: Colors.red,
          )
        ],
      ),
    );

Video:

zoom_issue.mp4

@VictorHoMetacrew
Copy link

Hello! Any update on this? It's even worse when you put the PageView in a ListView.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants