From b54e67385189e8c088837f4ccced6d15a9e8f147 Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Tue, 23 Jul 2024 14:44:37 +0545 Subject: [PATCH] refactor: Try to display image #2771 --- .../matrix_chat/matrix_chat_interface.dart | 1 - lib/chat_room/view/chat_room_view.dart | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/chat_room/matrix_chat/matrix_chat_interface.dart b/lib/chat_room/matrix_chat/matrix_chat_interface.dart index 8b6c06165..97a5169e8 100644 --- a/lib/chat_room/matrix_chat/matrix_chat_interface.dart +++ b/lib/chat_room/matrix_chat/matrix_chat_interface.dart @@ -33,7 +33,6 @@ abstract class MatrixChatInterface { int width = 500, int height = 500, }); - String getUrlFromImage(String url); Future login({ required String username, required String password, diff --git a/lib/chat_room/view/chat_room_view.dart b/lib/chat_room/view/chat_room_view.dart index dd75d6b28..54bb55adb 100644 --- a/lib/chat_room/view/chat_room_view.dart +++ b/lib/chat_room/view/chat_room_view.dart @@ -195,6 +195,19 @@ class _ChatRoomViewState extends State { event: event, fit: BoxFit.contain, ); + } + if (link.startsWith('mxc')) { + return MxcImage( + client: context + .read() + .matrixChat + .client!, + fit: BoxFit.contain, + width: 500, + height: 500, + uri: Uri.parse(link), + isThumbnail: false, + ); } else { return TransparentInkWell( onTap: () {