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 8
8
🐞 Fixed
9
9
10
10
- 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 )
11
13
- Fixed unread indicator button using hardcoded white color instead of theme color
12
14
` colorTheme.barsBg ` . [[ #2366 ]] ( https://github.com/GetStream/stream-chat-flutter/issues/2366 )
13
15
- 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 {
198
198
199
199
// Now that the file is saved, we need to copy it to the user's gallery
200
200
// 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
+ };
202
206
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
+ }
205
214
206
215
return path;
207
216
}
You can’t perform that action at this time.
0 commit comments