我正在Flutter中请求运行时权限。如何处理Flutter中的权限结果。众所周知,在Android中有onRequestPermissionsResult()。什么是Flutter中的替代方法。
答案 0 :(得分:0)
它可以检查,请求并获得回调权限
示例中的示例代码
requestPermission() async {
final res = await SimplePermissions.requestPermission(permission);
print("permission request result is " + res.toString());
}
checkPermission() async {
bool res = await SimplePermissions.checkPermission(permission);
print("permission is " + res.toString());
}
getPermissionStatus() async {
final res = await SimplePermissions.getPermissionStatus(permission);
print("permission status is " + res.toString());
}