File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
packages/stream_chat_flutter
lib/src/attachment/handler Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 88🐞 Fixed
99
1010- Fixed ` .replaceMentions ` not escaping special characters in the username.
11+ - Fixed videos not being saved to gallery correctly on mobile
12+ platforms. [[ #2357 ]] ( https://github.com/GetStream/stream-chat-flutter/issues/2357 )
1113- Fixed unread indicator button using hardcoded white color instead of theme color
1214 ` colorTheme.barsBg ` . [[ #2366 ]] ( https://github.com/GetStream/stream-chat-flutter/issues/2366 )
1315- Fixed ` GradientAvatars ` for users with same-length IDs would have identical
Original file line number Diff line number Diff line change @@ -198,10 +198,19 @@ class StreamAttachmentHandler extends StreamAttachmentHandlerBase {
198198
199199 // Now that the file is saved, we need to copy it to the user's gallery
200200 // because the gallery only shows files that are in the gallery folder.
201- await Gal .putImage (path);
201+ final copyToGallery = switch (file.mimeType) {
202+ final type? when type.startsWith ('image/' ) => Gal .putImage,
203+ final type? when type.startsWith ('video/' ) => Gal .putVideo,
204+ _ => null ,
205+ };
202206
203- // Once the file is copied to the gallery, we can delete the temporary file.
204- await file.delete ();
207+ if (copyToGallery != null ) {
208+ await copyToGallery.call (path);
209+
210+ // If the file was successfully copied to the gallery, we can safely
211+ // delete the temporary file.
212+ await file.delete ();
213+ }
205214
206215 return path;
207216 }
You can’t perform that action at this time.
0 commit comments