Skip to content

Commit

Permalink
Added info in all previews
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-pratik-k committed Jan 21, 2025
1 parent a76d52d commit 412dfb1
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions app/lib/ui/flow/media_preview/media_preview_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,22 @@ class _MediaPreviewState extends ConsumerState<MediaPreview> {
required AppMedia media,
required bool isZoomed,
}) {
void onDragUp(displacement) async {
if (displacement > 100) {
if (_videoPlayerController != null &&
(_videoPlayerController?.value.isInitialized ?? false)) {
_videoPlayerController?.pause();
}
MediaMetadataDetailsScreen.show(context, media);
}
}

if (media.type.isVideo && media.sources.contains(AppMediaSource.local)) {
return DismissiblePage(
backgroundColor: context.colorScheme.surface,
enableScale: false,
onDismiss: context.pop,
onDragUp: onDragUp,
onDragDown: _notifier.updateSwipeDownPercentage,
child: Center(
child: Consumer(
Expand Down Expand Up @@ -318,6 +329,7 @@ class _MediaPreviewState extends ConsumerState<MediaPreview> {
enableScale: false,
backgroundColor: context.colorScheme.surface,
onDismiss: context.pop,
onDragUp: onDragUp,
onDragDown: _notifier.updateSwipeDownPercentage,
child: _cloudVideoView(context: context, media: media),
);
Expand All @@ -328,12 +340,8 @@ class _MediaPreviewState extends ConsumerState<MediaPreview> {
onScaleChange: (scale) {
_notifier.updateIsImageZoomed(scale > 1);
},
onDragUp: (displacement) async {
if (displacement > 100) {
MediaMetadataDetailsScreen.show(context, media);
}
},
onDismiss: context.pop,
onDragUp: onDragUp,
onDragDown: _notifier.updateSwipeDownPercentage,
child: LocalMediaImagePreview(media: media, heroTag: widget.heroTag),
);
Expand All @@ -345,6 +353,7 @@ class _MediaPreviewState extends ConsumerState<MediaPreview> {
_notifier.updateIsImageZoomed(scale > 1);
},
onDismiss: context.pop,
onDragUp: onDragUp,
onDragDown: _notifier.updateSwipeDownPercentage,
child: NetworkImagePreview(media: media, heroTag: widget.heroTag),
);
Expand Down

0 comments on commit 412dfb1

Please sign in to comment.