更新
This commit is contained in:
@@ -123,7 +123,6 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
|
||||
} catch (e) {
|
||||
ef.log("$e");
|
||||
}
|
||||
// permission = await Geolocator.checkPermission();
|
||||
try {
|
||||
// 2️⃣ 检查权限(系统弹窗)—— 此时你的提示框仍然显示
|
||||
permission = await Geolocator.checkPermission();
|
||||
@@ -136,12 +135,9 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
|
||||
Navigator.of(Get.context!, rootNavigator: true).pop();
|
||||
}
|
||||
|
||||
if (permission == LocationPermission.denied) {
|
||||
permission = await Geolocator.requestPermission();
|
||||
if (permission == LocationPermission.denied) {
|
||||
if (permission == LocationPermission.denied) {
|
||||
return Future.error('位置权限被拒绝');
|
||||
}
|
||||
}
|
||||
|
||||
if (permission == LocationPermission.deniedForever) {
|
||||
return Future.error('位置权限被永久拒绝');
|
||||
|
||||
Reference in New Issue
Block a user