Skip to content

Commit

Permalink
Fix preview
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-pratik-k committed Mar 13, 2024
1 parent 072a620 commit 2ad7957
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
21 changes: 10 additions & 11 deletions app/lib/ui/flow/media_preview/image_preview_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@ class _ImagePreviewScreenState extends State<ImagePreviewScreen> {
tag: widget.heroTag,
child: SizedBox(
width: double.infinity,
child: Visibility(
visible: !widget.isLocal,
replacement: Image.file(File.fromUri(Uri.parse(widget.url)),
fit: BoxFit.fitWidth),
child: CachedNetworkImage(
imageUrl: widget.url,
fit: BoxFit.fitWidth,
progressIndicatorBuilder: (context, child, loadingProgress) =>
const AppCircularProgressIndicator(),
),
),
child: widget.isLocal
? Image.file(File.fromUri(Uri.parse(widget.url)),
fit: BoxFit.fitWidth)
: CachedNetworkImage(
imageUrl: widget.url,
fit: BoxFit.fitWidth,
progressIndicatorBuilder:
(context, child, loadingProgress) =>
const AppCircularProgressIndicator(),
),
),
),
),
Expand Down
5 changes: 4 additions & 1 deletion app/lib/ui/flow/media_preview/media_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ class AppMediaView {
required AppMedia media,
required String heroTag}) {
if (media.type.isImage) {
final path = media.sources.contains(AppMediaSource.local)
? media.path
: media.webContentLink;
AppRouter.imagePreview(
path: media.path,
path: path!,
heroTag: heroTag,
isLocal: media.sources.contains(AppMediaSource.local))
.push(context);
Expand Down

0 comments on commit 2ad7957

Please sign in to comment.