remove load user from SplashScreen

merge-update-with-lab-changes
Mohammad Aljammal 5 years ago committed by Mohammad Aljammal
parent 935e72975c
commit 9b8599a2cf

@ -30,28 +30,17 @@ class _SplashScreenState extends State<SplashScreen> {
Timer( Timer(
Duration(seconds: 1, milliseconds: 500), Duration(seconds: 1, milliseconds: 500),
() { () {
getUserData().then((value) { loadPrivilege().then((value) {
loadPrivilege().then((value) { Navigator.of(context).pushReplacement(
Navigator.of(context).pushReplacement( MaterialPageRoute(
MaterialPageRoute( builder: (BuildContext context) => LandingPage(),
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 /// load the Privilege from service
Future loadPrivilege() async { Future loadPrivilege() async {

Loading…
Cancel
Save