This commit is contained in:
wyf
2025-08-12 17:22:11 +08:00
parent b528ab950d
commit fcd3a281cf
20 changed files with 297 additions and 233 deletions

View File

@@ -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('位置权限被永久拒绝');