diff --git a/packages/stream_chat_flutter/lib/src/message_input.dart b/packages/stream_chat_flutter/lib/src/message_input.dart index 21dda0f4..c4888be2 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -1904,11 +1904,11 @@ class MessageInputState extends State { if (file == null) return; - final mimeType = file.name?.mimeType; + final mimeType = file.name?.mimeType ?? file.path.split('/').last.mimeType; final extraDataMap = {}; - if (mimeType.type == 'video' || mimeType.type == 'image') { + if (mimeType?.type == 'video' || mimeType?.type == 'image') { attachmentType = mimeType.type; } else { attachmentType = 'file';