requestPermission static method
请求权限
Implementation
static Future<PermissionStatus> requestPermission(List<Permission> permissionList) async {
Map<Permission, PermissionStatus> statuses = await permissionList.request();
PermissionStatus currentPermissionStatus = PermissionStatus.granted;
statuses.forEach((key, value) {
if (!value.isGranted) {
currentPermissionStatus = value;
return;
}
});
return currentPermissionStatus;
}