|
@@ -1,7 +1,9 @@
|
|
|
import 'dart:async';
|
|
|
|
|
|
+import 'package:flutter/foundation.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
+import 'package:vitalapp/store/store.dart';
|
|
|
import 'controller.dart';
|
|
|
|
|
|
class SplashPage extends GetView<SplashController> {
|
|
@@ -38,8 +40,15 @@ class _ImageAnimationState extends State<ImageAnimation>
|
|
|
_controller.loadData(),
|
|
|
animationCompleter.future,
|
|
|
]).then((_) {
|
|
|
-
|
|
|
- _controller.onRouteTo();
|
|
|
+
|
|
|
+ if (!kIsWeb || Store.user.token == null) {
|
|
|
+ _controller.onRouteTo();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (kIsWeb && Store.user.token != null) {
|
|
|
+ Get.offAllNamed("/");
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
|