Skip to content

Commit f74c1db

Browse files
committed
fix(ui): Use assetUrl as fallback for image thumbnail
This change adds `assetUrl` as a fallback option when determining the image URL for a thumbnail. The priority is now `thumbUrl`, then `imageUrl`, and finally `assetUrl`. This ensures that an image thumbnail can still be displayed even if the `thumbUrl` and `imageUrl` are not available, by using the local asset URL as a last resort.
1 parent fe0bce1 commit f74c1db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/stream_chat_flutter/lib/src/attachment/thumbnail/image_attachment_thumbnail.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ class StreamImageAttachmentThumbnail extends StatelessWidget {
9090

9191
// If the remote image URL is available, we can directly show it using
9292
// the _RemoteImageAttachment widget.
93-
if (image.thumbUrl ?? image.imageUrl case final imageUrl?) {
93+
final imageUrl = image.thumbUrl ?? image.imageUrl ?? image.assetUrl;
94+
if (imageUrl case final imageUrl?) {
9495
var resizedImageUrl = imageUrl;
9596
if (effectiveThumbnailSize case final thumbnailSize?) {
9697
resizedImageUrl = imageUrl.getResizedImageUrl(

0 commit comments

Comments
 (0)