diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 8980e7af..135ee46c 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -2,8 +2,9 @@ 🐞 Fixed -- SVG rendering fixes -- Use file extension instead of mimeType for downloading files +- SVG rendering fixes. +- Use file extension instead of mimeType for downloading files. +- [[#860]](https://github.com/GetStream/stream-chat-flutter/issues/860) CastError while compressing Videos. ✅ Added @@ -23,7 +24,7 @@ 🐞 Fixed -- [[#766]]`AttachmentActionsModal` now has customisation options for actions. +- [[#766]](https://github.com/GetStream/stream-chat-flutter/issues/766) `AttachmentActionsModal` now has customisation options for actions. - Fixed `MessageWidget` null errors associated with `channel.memberCount`. - Fixed adding attachments on web. - [[#767]](https://github.com/GetStream/stream-chat-flutter/issues/767): Fix `MessageInput` focus behaviour when sending messages. diff --git a/packages/stream_chat_flutter/lib/src/message_input.dart b/packages/stream_chat_flutter/lib/src/message_input.dart index de2b9d09..a43359ee 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -1129,13 +1129,14 @@ class MessageInputState extends State { if (file.size! > widget.maxAttachmentSize) { if (medium.type == AssetType.video && file.path != null) { - final mediaInfo = await (VideoService.compressVideo( + final mediaInfo = await VideoService.compressVideo( file.path!, frameRate: widget.compressedVideoFrameRate, quality: widget.compressedVideoQuality, - ) as FutureOr); + ); - if (mediaInfo.filesize! > widget.maxAttachmentSize) { + if (mediaInfo == null || + mediaInfo.filesize! > widget.maxAttachmentSize) { _showErrorAlert( context.translations.fileTooLargeAfterCompressionError( widget.maxAttachmentSize / (1024 * 1024),