更新
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user