|
|
|
|
@ -30,28 +30,17 @@ class _SplashScreenState extends State<SplashScreen> {
|
|
|
|
|
Timer(
|
|
|
|
|
Duration(seconds: 1, milliseconds: 500),
|
|
|
|
|
() {
|
|
|
|
|
getUserData().then((value) {
|
|
|
|
|
loadPrivilege().then((value) {
|
|
|
|
|
Navigator.of(context).pushReplacement(
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => LandingPage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
loadPrivilege().then((value) {
|
|
|
|
|
Navigator.of(context).pushReplacement(
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => LandingPage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getUserData() async {
|
|
|
|
|
var data = await sharedPref.getObject(USER_PROFILE);
|
|
|
|
|
if (data != null) {
|
|
|
|
|
AuthenticatedUser userData = AuthenticatedUser.fromJson(data);
|
|
|
|
|
Provider.of<ProjectViewModel>(context, listen: false).isLogin = true;
|
|
|
|
|
authenticatedUserObject.isLogin = true;
|
|
|
|
|
authenticatedUserObject.user = userData;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// load the Privilege from service
|
|
|
|
|
Future loadPrivilege() async {
|
|
|
|
|
|