-
Notifications
You must be signed in to change notification settings - Fork 3
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
Faster image scrolling and fix zoom out issue #519
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import 'package:reaxit/models.dart'; | |
import 'package:reaxit/ui/theme.dart'; | ||
import 'package:share_plus/share_plus.dart'; | ||
import 'package:gal/gal.dart'; | ||
import 'package:reaxit/ui/widgets/cached_image.dart'; | ||
|
||
abstract class GalleryCubit<T> extends StateStreamableSource<T> { | ||
Future<void> updateLike({required bool liked, required int index}); | ||
|
@@ -169,9 +170,13 @@ class _GalleryState<C extends GalleryCubit> extends State<Gallery> | |
child = GestureDetector( | ||
onDoubleTap: () => _likePhoto(photos, i), | ||
child: RotatedBox( | ||
quarterTurns: photos[i].rotation ~/ 90, | ||
child: Image.network(photos[i].full), | ||
), | ||
quarterTurns: photos[i].rotation ~/ 90, | ||
child: CachedImage( | ||
imageUrl: photos[i].full, | ||
fit: BoxFit.contain, | ||
// placeholder: | ||
// 'assets/img/photo_placeholder_${(360 - photos[i].rotation) % 360}.png'), | ||
)), | ||
); | ||
} else { | ||
child = const Center( | ||
|
@@ -181,7 +186,7 @@ class _GalleryState<C extends GalleryCubit> extends State<Gallery> | |
|
||
return PhotoViewGalleryPageOptions.customChild( | ||
child: child, | ||
minScale: PhotoViewComputedScale.contained * 0.8, | ||
minScale: PhotoViewComputedScale.contained * 1, | ||
Comment on lines
-184
to
+189
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason this was changed? I cannot test this atm, I will test next week There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With 0.8, you can zoom out the image from its default position. Not just 'pinch' it, but after that it will suddenly not take the full width up anymore, which we thought was pretty cursed. Putting it at 1 instead solves that so fully zoomed out is still the full screen width. |
||
maxScale: PhotoViewComputedScale.covered * 2, | ||
); | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can go