chore: Display loading dialog when preparing voice message
Signed-off-by: Christian Kußowski <c.kussowski@famedly.com>
This commit is contained in:
parent
6c332c1d83
commit
dc26309489
1 changed files with 10 additions and 1 deletions
|
|
@ -626,10 +626,19 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
);
|
||||
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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue