controller.dart 538 B

12345678910111213141516171819202122232425262728293031
  1. import 'package:get/get.dart';
  2. import 'package:vnoteapp/architecture/defines.dart';
  3. import 'package:vnoteapp/store/store.dart';
  4. import 'state.dart';
  5. class SplashController extends FControllerBase {
  6. final state = SplashState();
  7. void onRouteTo() async {
  8. if (Store.user.isLogOn) {
  9. Get.offAllNamed("/");
  10. } else {
  11. Get.offAllNamed("/login");
  12. }
  13. }
  14. @override
  15. void onReady() {
  16. //
  17. super.onReady();
  18. }
  19. @override
  20. void onClose() {
  21. _doDispose();
  22. super.onClose();
  23. }
  24. void _doDispose() {}
  25. }