requestVideoCallPermissions static method
Future<bool>
requestVideoCallPermissions({
- required List<
Permission> permissions, - bool showFromRational = false,
- required BuildContext context,
Implementation
static Future<bool> requestVideoCallPermissions({required List<Permission> permissions, bool showFromRational = false, required BuildContext context}) async {
var info = await PackageInfo.fromPlatform();
if(context.mounted) {
var deniedPopupValue = await mirrorFlyPermissionDialog(
icon: recordAudioVideoPermission,
content: Constants.videoCallPermission, context: context, appName: info.appName);
if (deniedPopupValue) {
var newp = await permissions.request();
PermissionStatus? microphone_ = newp[Permission.microphone];
PermissionStatus? phone_ = newp[Permission.phone];
PermissionStatus? camera_ = newp[Permission.camera];
PermissionStatus? bluetoothConnect_ = newp[Permission.bluetoothConnect];
if (camera_ != null && camera_.isPermanentlyDenied) {
SessionManagement.setBool(Constants.cameraPermissionAsked, true);
}
if (microphone_ != null && microphone_.isPermanentlyDenied) {
SessionManagement.setBool(Constants.audioRecordPermissionAsked, true);
}
if (phone_ != null && phone_.isPermanentlyDenied) {
SessionManagement.setBool(Constants.readPhoneStatePermissionAsked, true);
}
if (bluetoothConnect_ != null && bluetoothConnect_.isPermanentlyDenied) {
SessionManagement.setBool(Constants.bluetoothPermissionAsked, true);
}
return (camera_?.isGranted ?? true) && (microphone_?.isGranted ?? true) && (phone_?.isGranted ?? true) &&
(bluetoothConnect_?.isGranted ?? true);
} else {
return false;
}
}else{
LogMessage.d("requestAudioCallPermissions", "Context is Not Mounted");
return false;
}
}