1234567891011121314151617181920212223242526272829303132333435363738 |
- import 'dart:async';
- import 'package:get/get.dart';
- import 'package:vitalapp/architecture/defines.dart';
- import 'package:vitalapp/managers/interfaces/system_setting.dart';
- import 'package:vitalapp/store/store.dart';
- import 'state.dart';
- class SplashController extends FControllerBase {
- final state = SplashState();
- /// 跳转路由
- void onRouteTo() async {
- /// 重启后,统一到登录页
- Get.offAllNamed("/login");
- }
- /// 加载数据
- Future<void> loadData() async {
- await Future.wait([
- _loadServerSettings(),
- // 其他异步加载项
- ]);
- }
- /// 加载服务配置
- Future<void> _loadServerSettings() async {
- await Get.find<ISystemSettingManager>().getSettings(true);
- }
- @override
- void onClose() {
- _doDispose();
- super.onClose();
- }
- void _doDispose() {}
- }
|