This commit is contained in:
wyf
2025-11-14 12:01:07 +08:00
parent 776275aa3d
commit 7e44998240
24 changed files with 409 additions and 187 deletions

View File

@@ -455,18 +455,19 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
Future<void> onInit() async {
super.onInit();
try {
await getCurrentLocation();
_weatherTimer = Timer.periodic(Duration(minutes: 10), (timer) {
getCurrentWeather(); // 每 60 秒更新一次天气
});
//去掉天气
// try {
// await getCurrentLocation();
// _weatherTimer = Timer.periodic(Duration(minutes: 10), (timer) {
// getCurrentWeather(); // 每 60 秒更新一次天气
// });
_locationTimer = Timer.periodic(Duration(minutes: 10), (timer) {
getCurrentLocation(); // 每 10 分钟更新一次位置
});
} catch (e) {
ef.log("[天气和定位请求失败]");
}
// _locationTimer = Timer.periodic(Duration(minutes: 10), (timer) {
// getCurrentLocation(); // 每 10 分钟更新一次位置
// });
// } catch (e) {
// ef.log("[天气和定位请求失败]");
// }
}
@override