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, );