Skip to content

Commit

Permalink
refactor: Try to display image #2771
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Aug 15, 2024
1 parent 6b032cf commit b54e673
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/chat_room/matrix_chat/matrix_chat_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ abstract class MatrixChatInterface {
int width = 500,
int height = 500,
});
String getUrlFromImage(String url);
Future<String> login({
required String username,
required String password,
Expand Down
13 changes: 13 additions & 0 deletions lib/chat_room/view/chat_room_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ class _ChatRoomViewState<B extends ChatRoomCubit> extends State<ChatRoomView> {
event: event,
fit: BoxFit.contain,
);
}
if (link.startsWith('mxc')) {
return MxcImage(
client: context
.read<AltmeChatSupportCubit>()
.matrixChat
.client!,
fit: BoxFit.contain,
width: 500,
height: 500,
uri: Uri.parse(link),
isThumbnail: false,
);
} else {
return TransparentInkWell(
onTap: () {
Expand Down

0 comments on commit b54e673

Please sign in to comment.