Open bierbaumtim opened 4 years ago
It's not woking in Android too, must pop button to dismiss it. so funny😂
OK, thats interesting, because on Android Emulator everything works fine
you can try it by PhotoViewGallery
,it will Smile at you 🤣
Here a short list on which devices it’s working and on which not.
Working:
Not Working
Oh, I also have this bug, it works fine on Android Emulator, but something wrong on my Android mobile phone.
GestureDetector(
onLongPress: _onImageLongPress,
child: Listener(
onPointerUp: _onPointerUp,
onPointerDown: _onPointerDown,
child: PhotoViewGallery.builder(...),
),
)
I'm having the same issue. Works good on iPhone 11 Pro, but doesn't work on iPhone XS Max
onPanUpdate event of GestureDetector have the same issue. drag doesn't work on iPhone.
Gallery wrapped into Dismissable working when image horizontal or square and randomly not working (50/50) when image is vertical. Setting custom size Size(mediaQuery.size.width - 3, mediaQuery.size.height)
solved problem. I dont know why, but intercepting drag events depends on image size and aspect ratio:)
I added logs and found error in math operations with floating point. Image width multiplied on scale sometimes different then widget width and it blocks any gestures except zooming.
HitCorners _hitCornersX() {
final double childWidth = scaleBoundaries.childSize.width * scale;
final double screenWidth = scaleBoundaries.outerSize.width;
log('HIT: childW=${scaleBoundaries.childSize.width} childWScaled=$childWidth screenW=$screenWidth');
if (screenWidth >= childWidth) {
return const HitCorners(true, true);
}
final x = -position.dx;
final cornersX = this.cornersX();
return HitCorners(x <= cornersX.min, x >= cornersX.max);
}
Fixed:
if (screenWidth - childWidth > -0.001) {
return const HitCorners(true, true);
}
Describe the bug I've wrapped the PhotoViewGallery inside an GestureDetector. If i tapped on a random position on the screen, the onTap event of the upper GestureDetector never fired. Dragging vertical, only be fired the onDrag events only in maybe 2 of 10 times.
The widget is the child of a PopupRoute.
What is the current behavior? Upper GestureDetector not properly receiving events on iOS.
Expected behavior If onTapDown and onTapUp on PhotoView is null, a available upper GestureDetector should receive all events, including onTap and onDragStart......
my code:
Which versions of Flutter/Photo View, and which browser / OS are affected by this issue? Did this work in previous versions of Photo View?
flutter doctor:
OS Version: iOS 13.x photo_view: 0.9.0