Skip to content

Commit

Permalink
Merge branch 'develop' into svg-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
imtoori authored Dec 27, 2021
2 parents 3ecfb74 + 5a4fe29 commit 7f24be3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
🐞 Fixed

- SVG rendering fixes
- Use file extension instead of mimeType for downloading files

✅ Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,13 @@ class AttachmentActionsModal extends StatelessWidget {
}) async {
String? filePath;
final appDocDir = await getTemporaryDirectory();
final url =
attachment.assetUrl ?? attachment.imageUrl ?? attachment.thumbUrl!;
await Dio().download(
attachment.assetUrl ?? attachment.imageUrl ?? attachment.thumbUrl!,
url,
(Headers responseHeaders) {
final contentType = responseHeaders[Headers.contentTypeHeader]!;
final mimeType = contentType.first.split('/').last;
filePath ??= '${appDocDir.path}/${attachment.id}.$mimeType';
final ext = Uri.parse(url).pathSegments.last;
filePath ??= '${appDocDir.path}/${attachment.id}.$ext';
return filePath!;
},
onReceiveProgress: progressCallback,
Expand Down

0 comments on commit 7f24be3

Please sign in to comment.