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;
|
if (result == null) return;
|
||||||
final audioFile = XFile(result.path);
|
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(
|
final file = MatrixAudioFile(
|
||||||
bytes: await audioFile.readAsBytes(),
|
bytes: bytes,
|
||||||
name: result.fileName ?? audioFile.path,
|
name: result.fileName ?? audioFile.path,
|
||||||
);
|
);
|
||||||
|
|
||||||
await room.sendFileEvent(
|
await room.sendFileEvent(
|
||||||
file,
|
file,
|
||||||
inReplyTo: replyEvent,
|
inReplyTo: replyEvent,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue