flutter 申请麦克风权限
作者:互联网
// 检查是否已有读写麦克风的权限
bool status = await Permission.microphone.isGranted;
//判断如果还没拥有麦克风权限就申请获取权限 if (!status) { return await Permission.microphone.request().isGranted; }
if (status != PermissionStatus.granted) { print('发生异常了。。。。'); }
//判断如果还没拥有麦克风权限就申请获取权限 if (!status) { return await Permission.microphone.request().isGranted; }
if (status != PermissionStatus.granted) { print('发生异常了。。。。'); }
标签:status,microphone,麦克风,await,权限,isGranted,flutter 来源: https://www.cnblogs.com/liuys635/p/14851939.html