Permission Issue

merge-requests/133/head
Aamir Muhammad 2 years ago
parent 1f69ee262d
commit b152f8a6d6

@ -1201,55 +1201,29 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
void startRecoding(BuildContext context) async {
await Permission.microphone.request().then((PermissionStatus status) async {
if (Platform.isIOS) {
if (status.isPermanentlyDenied) {
Utils.confirmDialog(
context,
"The app needs microphone access to be able to record audio.",
onTap: () {
openAppSettings().then((bool value) {
if (status.isGranted) {
Navigator.of(context).pop();
}
});
},
);
} else if (status.isDenied) {
Utils.confirmDialog(
context,
"The app needs microphone access to be able to record audio.",
onTap: () {
openAppSettings().then((bool value) {
if (status.isGranted) {
Navigator.of(context).pop();
}
});
},
);
} else if (status.isGranted) {
sRecoding();
} else {
startRecoding(context);
}
await Permission.microphone.request().then((PermissionStatus status) {
if (status.isPermanentlyDenied) {
Utils.confirmDialog(
context,
"The app needs microphone access to be able to record audio.",
onTap: () {
Navigator.of(context).pop();
openAppSettings();
},
);
} else if (status.isDenied) {
Utils.confirmDialog(
context,
"The app needs microphone access to be able to record audio.",
onTap: () {
Navigator.of(context).pop();
openAppSettings();
},
);
} else if (status.isGranted) {
sRecoding();
} else {
if (status.isPermanentlyDenied) {
Utils.confirmDialog(
context,
"The app needs microphone access to be able to record audio.",
onTap: () {
openAppSettings().then((bool value) {
if (status.isGranted) {
Navigator.of(context).pop();
}
});
},
);
} else if (status.isGranted) {
sRecoding();
} else {
startRecoding(context);
}
startRecoding(context);
}
});
}

Loading…
Cancel
Save