diff --git a/lib/pages/chat.dart b/lib/pages/chat.dart index 9484d0070..641576450 100644 --- a/lib/pages/chat.dart +++ b/lib/pages/chat.dart @@ -21,7 +21,7 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:image_picker/image_picker.dart'; -import 'package:permission_handler/permission_handler.dart'; +import 'package:record/record.dart'; import 'package:scroll_to_index/scroll_to_index.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:vrouter/vrouter.dart'; @@ -332,10 +332,7 @@ class ChatController extends State { } void voiceMessageAction() async { - if (await Permission.microphone.isGranted != true) { - final status = await Permission.microphone.request(); - if (status != PermissionStatus.granted) return; - } + if (await Record().hasPermission() == false) return; final result = await showDialog( context: context, useRootNavigator: false,