From 9f002f32b301ff3c21fcb976e93275170903bcb9 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 15 Mar 2021 12:25:20 +0100 Subject: [PATCH] fix video upload --- packages/stream_chat_flutter/lib/src/message_input.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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';