diff --git a/lib/config/config.dart b/lib/config/config.dart index 58ade1bc..2592d1b2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -7,8 +7,8 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; -const BASE_URL = 'https://uat.hmgwebservices.com/'; - //const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/'; + const BASE_URL = 'https://hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; ///Doctor diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 8d522b1d..3f64afa3 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -147,7 +147,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.getToken().then((String token) { sharedPref.setString(PUSH_TOKEN, token); - if (token != null && DEVICE_TOKEN == "") { + if (token != null) { DEVICE_TOKEN = token; checkUserStatus(token); } @@ -410,9 +410,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { SETTINGS, ); else - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); + login(); }, //do something, ) ], @@ -553,4 +551,15 @@ class _LandingPageState extends State with WidgetsBindingObserver { _changeCurrentTab(2); } } + 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 { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + } } diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 229e0a0f..87eaf1ce 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -370,7 +370,7 @@ class _ConfirmLogin extends State { if (authenticated == true) { - if(user.logInType==2 || user.logInType ==3){ + if(user !=null && (user.logInType==2 || user.logInType ==3)){ this.checkActivationCode(); }else{ var request = this.getCommonRequest(type: type);