login navigation changed for the drawer login

king_kahild_app_updated_3.32
taha.alam 1 year ago
parent 0f592c8a92
commit 8636180de3

@ -425,7 +425,6 @@ class _AppDrawerState extends State<AppDrawer> {
login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
@ -433,20 +432,44 @@ class _AppDrawerState extends State<AppDrawer> {
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
setUserValues(value);
sharedPref.setObject(IMEI_USER_DATA, value);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
LOGIN_TYPE,
);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
LOGIN_TYPE,
);
});
}
// var data = await sharedPref.getObject(IMEI_USER_DATA);
// sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
//
// if (data != null) {
// Navigator.of(context).pushNamed(CONFIRM_LOGIN);
// } else {
// GifLoaderDialogUtils.showMyDialog(context);
// authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
// GifLoaderDialogUtils.hideDialog(context);
// if (value != null) {
// setUserValues(value);
// Navigator.of(context).pushNamed(CONFIRM_LOGIN);
// } else {
// Navigator.of(context).pushNamed(
// WELCOME_LOGIN,
// );
// }
// }).catchError((err) {
// GifLoaderDialogUtils.hideDialog(context);
// Navigator.of(context).pushNamed(
// WELCOME_LOGIN,
// );
// });
// }
locator<GAnalytics>().loginRegistration.login_register_initiate();
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('login');
}

Loading…
Cancel
Save