remove load user from SplashScreen

merge-requests/224/merge
Mohammad Aljammal 5 years ago committed by Mohammad Aljammal
parent 935e72975c
commit 9b8599a2cf

@ -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 {

Loading…
Cancel
Save