|
|
|
@ -1200,7 +1200,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
playerController.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void startRecoding() async {
|
|
|
|
|
void startRecoding(BuildContext context) async {
|
|
|
|
|
// if (await Permission.microphone.request().isGranted) {
|
|
|
|
|
// sRecoding();
|
|
|
|
|
// } else {
|
|
|
|
@ -1209,13 +1209,25 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
// }
|
|
|
|
|
await Permission.microphone.request().then((PermissionStatus status) {
|
|
|
|
|
if (status.isPermanentlyDenied) {
|
|
|
|
|
openAppSettings();
|
|
|
|
|
Utils.confirmDialog(
|
|
|
|
|
context,
|
|
|
|
|
"The app needs microphone access to be able to record audio.",
|
|
|
|
|
onTap: () {
|
|
|
|
|
openAppSettings();
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
} else if (status.isDenied) {
|
|
|
|
|
openAppSettings();
|
|
|
|
|
Utils.confirmDialog(
|
|
|
|
|
context,
|
|
|
|
|
"The app needs microphone access to be able to record audio.",
|
|
|
|
|
onTap: () {
|
|
|
|
|
openAppSettings();
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
} else if (status.isGranted) {
|
|
|
|
|
sRecoding();
|
|
|
|
|
} else {
|
|
|
|
|
startRecoding();
|
|
|
|
|
startRecoding(context);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|