[BUG] the scaleStateCycle only works when the image is in minScale and also when tapped on the bottom corners of the screen #540
Labels
bug
Something isn't working
Projects
Describe the bug
This happens when i use PhotoViewGalleryPageOptions, there is nothing odd in my code, i even tried the examples, and still it doesnt work, in samsung. i havent tried it in other platforms.
To Reproduce
just try any PhotoViewGalleryPageOptions, on samsung, then try to double tap. i have seen all the reports that are similar to my problem, and i don't think there is a solution. also i tried clicking by mouse using otg, and it works like expected. the problem is when tapping using a finger. i would really appreciate any workarounds.
What is the current behavior?
Expected behavior
wanted to react to my doubletap
Screenshots
body: PhotoViewGallery.builder(
scrollPhysics: const BouncingScrollPhysics(),
builder: (BuildContext context, int index) {
return PhotoViewGalleryPageOptions(
imageProvider:
AssetImage('assets/images/${widget.imageUrls[index]}'),
// scaleStateController: _scaleStateController,
scaleStateCycle: myScaleStateCycle,
initialScale: PhotoViewComputedScale.contained * 1,
minScale: PhotoViewComputedScale.contained * 0.9,
maxScale: PhotoViewComputedScale.covered * 2,
controller: _controller,
gestureDetectorBehavior: HitTestBehavior.opaque,
);
},
itemCount: widget.imageUrl.length,
pageController: pageController,
),
/////////////////////////////////////////////////////////////////////////////////////////////////////
PhotoViewScaleState myScaleStateCycle(PhotoViewScaleState actual) {
switch (actual) {
case PhotoViewScaleState.zoomedIn:
case PhotoViewScaleState.zoomedOut:
case PhotoViewScaleState.covering:
return PhotoViewScaleState.initial;
case PhotoViewScaleState.initial:
case PhotoViewScaleState.originalSize:
default:
return PhotoViewScaleState.covering;
}
}
Which versions of Flutter/Photo View, and which browser / OS are affected by this issue? Did this work in previous versions of Photo View?
photo_view: ^0.14.0
The text was updated successfully, but these errors were encountered: