From 37ad5d72be89dc6860f7a4ae5b609f798e749476 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Mon, 30 Nov 2020 20:30:32 +0530 Subject: [PATCH] fixes --- lib/src/full_screen_media.dart | 1 - lib/src/image_footer.dart | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/full_screen_media.dart b/lib/src/full_screen_media.dart index fed1b9a7..a0c4a03f 100644 --- a/lib/src/full_screen_media.dart +++ b/lib/src/full_screen_media.dart @@ -82,7 +82,6 @@ class _FullScreenMediaState extends State }); }, itemBuilder: (context, position) { - print(widget.mediaAttachments[position].type); if (widget.mediaAttachments[position].type == 'image' || widget.mediaAttachments[position].type == 'giphy') { return PhotoView( diff --git a/lib/src/image_footer.dart b/lib/src/image_footer.dart index a4651cf7..dcc5c5d8 100644 --- a/lib/src/image_footer.dart +++ b/lib/src/image_footer.dart @@ -465,7 +465,10 @@ class _ImageFooterState extends State { widget.mediaAttachments[widget.currentPage].imageUrl ?? widget.mediaAttachments[widget.currentPage].assetUrl ?? widget.mediaAttachments[widget.currentPage].thumbUrl; - var type = url?.split('?')?.first?.split('.')?.last ?? 'jpg'; + var type = + widget.mediaAttachments[widget.currentPage].type == 'image' + ? 'jpg' + : url?.split('?')?.first?.split('.')?.last ?? 'jpg'; var request = await HttpClient().getUrl(Uri.parse(url)); var response = await request.close(); var bytes = await consolidateHttpClientResponseBytes(response); @@ -583,7 +586,7 @@ class _ImageFooterState extends State { message = (Message()).copyWith( text: text, - attachments: attachments, + attachments: [attachments[widget.currentPage]], mentionedUsers: [], showInChannel: false, );