Commit aba0f1db4d1c57c7e02a07a526ded79a64ddedc9

Authored by 常守达
1 parent b9503e55

fix(today):loading时加载数据

import 'package:doublefeel_flutter/core/services/health_raw_data_core_service.dart';
import 'package:flutter/scheduler.dart';
import 'package:get/get.dart';
... ... @@ -23,6 +24,8 @@ class SplashController extends GetxController {
final UserApi _userApi;
final VipApi _vipApi;
final UserStateService _userStateService;
final HealthRawDataCoreService _healthRawDataCoreService =
Get.find<HealthRawDataCoreService>();
@override
void onInit() {
... ... @@ -45,7 +48,10 @@ class SplashController extends GetxController {
final ok = await _refreshSession();
if (ok) {
await _userStateService.onLogin();
Get.offAllNamed(AppRoutes.home);
try {
await _healthRawDataCoreService.startCoreCaculate();
} catch (_) {}
await Get.offAllNamed(AppRoutes.home);
} else {
Get.offAllNamed(AppRoutes.login);
}
... ...