-
Notifications
You must be signed in to change notification settings - Fork 548
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
Tap callbacks in PhotoViewGalleryPageOptions #146
Comments
Great catch! |
A fix for that has been included on master, since photoview 0.4.0 is not yet beta compatible, I wont publish any release for now. However, you can depend directly on our master to get that enhancement. |
@renancaraujo Also, I tried depend directly on master and #150 seems to be fixed, but the callbacks that you added to fix this issue are never called. You can run the code below and check that "onTapUp" and "onTapDown" are never printed: import 'package:flutter/material.dart';
import 'package:photo_view/photo_view_gallery.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(body: Foo()),
);
}
}
class Foo extends StatelessWidget {
static const List<String> images = [
'https://homepages.cae.wisc.edu/~ece533/images/peppers.png',
'https://homepages.cae.wisc.edu/~ece533/images/baboon.png',
'https://homepages.cae.wisc.edu/~ece533/images/girl.png',
];
@override
Widget build(BuildContext context) {
return PhotoViewGallery.builder(
itemCount: images.length,
builder: (_, int index) {
return PhotoViewGalleryPageOptions(
imageProvider: NetworkImage(images[index]),
onTapUp: (_, __, ___) => print('onTapUp'),
onTapDown: (_, __, ___) => print('onTapDown'),
);
},
);
}
} |
Because it's not passed to the PhotoView. I have the exactly same problem here. |
Supposed to be solved on 0.4.2 |
Like
PhotoView
,PhotoViewGalleryPageOptions
should have tap callbacks (onTapUp
andonTapDown
).Giving a context, the gallery of my app shows/hides
AppBar
on user tap, just like WhatsApp.The text was updated successfully, but these errors were encountered: