diff --git a/packages/stream_chat_flutter/lib/src/fullscreen_media/full_screen_media.dart b/packages/stream_chat_flutter/lib/src/fullscreen_media/full_screen_media.dart index f5a73361..53e6f1a1 100644 --- a/packages/stream_chat_flutter/lib/src/fullscreen_media/full_screen_media.dart +++ b/packages/stream_chat_flutter/lib/src/fullscreen_media/full_screen_media.dart @@ -288,12 +288,8 @@ class _FullScreenMediaState extends State { : Colors.black, child: Builder( builder: (context) { - if (attachment.type == 'image' || - attachment.type == 'giphy') { - final imageUrl = attachment.imageUrl ?? - attachment.assetUrl ?? - attachment.thumbUrl; - + if (attachment.type == AttachmentType.image || + attachment.type == AttachmentType.giphy) { return PhotoView.customChild( maxScale: PhotoViewComputedScale.covered, minScale: PhotoViewComputedScale.contained, @@ -306,7 +302,7 @@ class _FullScreenMediaState extends State { height: double.infinity, ), ); - } else if (attachment.type == 'video') { + } else if (attachment.type == AttachmentType.video) { final controller = videoPackages[attachment.id]!; if (!controller.initialized) { return const Center( diff --git a/packages/stream_chat_flutter/lib/src/fullscreen_media/full_screen_media_desktop.dart b/packages/stream_chat_flutter/lib/src/fullscreen_media/full_screen_media_desktop.dart index e469386a..787b4b3d 100644 --- a/packages/stream_chat_flutter/lib/src/fullscreen_media/full_screen_media_desktop.dart +++ b/packages/stream_chat_flutter/lib/src/fullscreen_media/full_screen_media_desktop.dart @@ -317,12 +317,8 @@ class _FullScreenMediaDesktopState extends State { : Colors.black, child: Builder( builder: (context) { - if (attachment.type == 'image' || - attachment.type == 'giphy') { - final imageUrl = attachment.imageUrl ?? - attachment.assetUrl ?? - attachment.thumbUrl; - + if (attachment.type == AttachmentType.image || + attachment.type == AttachmentType.giphy) { return PhotoView.customChild( maxScale: PhotoViewComputedScale.covered, minScale: PhotoViewComputedScale.contained, @@ -335,7 +331,7 @@ class _FullScreenMediaDesktopState extends State { height: double.infinity, ), ); - } else if (attachment.type == 'video') { + } else if (attachment.type == AttachmentType.video) { final package = videoPackages[attachment.id]!; package.player.open( Playlist(