From dc263094898f51a486611529c87b4a3287ba1047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Sat, 10 May 2025 10:17:59 +0200 Subject: [PATCH] chore: Display loading dialog when preparing voice message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian Kußowski --- lib/pages/chat/chat.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 94c1ed431..1103c47fa 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -626,10 +626,19 @@ class ChatController extends State ); if (result == null) return; final audioFile = XFile(result.path); + + final bytesResult = await showFutureLoadingDialog( + context: context, + future: audioFile.readAsBytes, + ); + final bytes = bytesResult.result; + if (bytes == null) return; + final file = MatrixAudioFile( - bytes: await audioFile.readAsBytes(), + bytes: bytes, name: result.fileName ?? audioFile.path, ); + await room.sendFileEvent( file, inReplyTo: replyEvent,