controller.dart 829 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import 'dart:async';
  2. import 'package:get/get.dart';
  3. import 'package:vitalapp/architecture/defines.dart';
  4. import 'package:vitalapp/managers/interfaces/system_setting.dart';
  5. import 'package:vitalapp/store/store.dart';
  6. import 'state.dart';
  7. class SplashController extends FControllerBase {
  8. final state = SplashState();
  9. /// 跳转路由
  10. void onRouteTo() async {
  11. /// 重启后,统一到登录页
  12. Get.offAllNamed("/login");
  13. }
  14. /// 加载数据
  15. Future<void> loadData() async {
  16. await Future.wait([
  17. _loadServerSettings(),
  18. // 其他异步加载项
  19. ]);
  20. }
  21. /// 加载服务配置
  22. Future<void> _loadServerSettings() async {
  23. await Get.find<ISystemSettingManager>().getSettings(true);
  24. }
  25. @override
  26. void onClose() {
  27. _doDispose();
  28. super.onClose();
  29. }
  30. void _doDispose() {}
  31. }