fix: Record voice messages
This commit is contained in:
parent
5bff4b753f
commit
0a52d26043
2 changed files with 36 additions and 17 deletions
|
|
@ -356,13 +356,13 @@ class ChatController extends State<Chat> {
|
|||
|
||||
void voiceMessageAction() async {
|
||||
if (await Record().hasPermission() == false) return;
|
||||
final result = await showDialog<Map>(
|
||||
final result = await showDialog<RecordingResult>(
|
||||
context: context,
|
||||
useRootNavigator: false,
|
||||
builder: (c) => const RecordingDialog(),
|
||||
);
|
||||
if (result == null) return;
|
||||
final audioFile = File(result['path']);
|
||||
final audioFile = File(result.path);
|
||||
final file = MatrixAudioFile(
|
||||
bytes: audioFile.readAsBytesSync(),
|
||||
name: audioFile.path,
|
||||
|
|
@ -373,7 +373,7 @@ class ChatController extends State<Chat> {
|
|||
room.sendFileEvent(file, inReplyTo: replyEvent, extraContent: {
|
||||
'info': {
|
||||
...file.info,
|
||||
'duration': result['duration'],
|
||||
'duration': result.duration,
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue