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

How to support longPress gesture on Gallery exmaple? #548

Open
OpenJarvisAI opened this issue Jan 2, 2024 · 1 comment
Open

How to support longPress gesture on Gallery exmaple? #548

OpenJarvisAI opened this issue Jan 2, 2024 · 1 comment

Comments

@OpenJarvisAI
Copy link

How to support longPress gesture on Gallery exmaple?

@SeakyLuo
Copy link

This is what I just found out according to the implementation of the PhotoViewGallery .

Don't use the PhotoViewGallery provided. Just use the PhotoViewGestureDetectorScope from the package to wrap your PageView.builder. If you want to zoom in and out the image, you can use the PhotoView from the package in the itemBuilder.
Then you wrap the whatever image widget with GestureDetector.

return PhotoViewGestureDetectorScope( axis: Axis.horizontal, child: PageView.builder( itemCount: totalPages, controller: _pageController, onPageChanged: _onPageChanged, itemBuilder: _buildPage, ), );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants