mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 04:37:55 +00:00
Modified Devices Pages
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/navigation/routing_constants.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
|
||||
class SplashView extends StatelessWidget {
|
||||
const SplashView({super.key});
|
||||
@@ -9,15 +11,16 @@ class SplashView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//TODO remove this delay
|
||||
Future.delayed(
|
||||
const Duration(seconds: 5),
|
||||
() {
|
||||
Navigator.popAndPushNamed(
|
||||
context,
|
||||
Routes.authLogin,
|
||||
);
|
||||
},
|
||||
);
|
||||
Future.value().then((value) async {
|
||||
var isLoggedIn = await const FlutterSecureStorage()
|
||||
.read(key: Constants.tokenAccessKey) !=
|
||||
null;
|
||||
if (isLoggedIn) {
|
||||
Navigator.pushReplacementNamed(context, Routes.homeRoute);
|
||||
} else {
|
||||
Navigator.pushReplacementNamed(context, Routes.authLogin);
|
||||
}
|
||||
});
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
alignment: Alignment.center,
|
||||
|
||||
Reference in New Issue
Block a user