requestPermissionIfNeed method
dynamic
requestPermissionIfNeed()
Implementation
requestPermissionIfNeed() async {
if (await checkLocationService() &&
await Permission.location.request().isDenied) {
Map<Permission, PermissionStatus> statuses = await [
Permission.location,
].request();
if (statuses[Permission.location] != PermissionStatus.granted) {
BZLoading.toast("未获取到定位权限");
return;
}
}
}