diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 2094efd9..f1ab7c46 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -151,16 +151,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.getToken().then((String token) async { sharedPref.setString(PUSH_TOKEN, token); - if (token != null && await sharedPref.getObject(USER_PROFILE) == null) { - DEVICE_TOKEN = token; - checkUserStatus(token); - } else { - getNotificationCount(token); - } - - requestPermissions(); - }).catchError((err) { - print(err); + Future.delayed(Duration.zero, () async { + if (token != null && await sharedPref.getObject(USER_PROFILE) == null) { + DEVICE_TOKEN = token; + checkUserStatus(token); + } else if (await sharedPref.getObject(USER_PROFILE) != null) { + getNotificationCount(token); + } + }).catchError((err) { + print(err); + }); }); // // //_firebase Background message handler @@ -516,12 +516,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { // themeNotifier.setTheme(defaultTheme); } void checkUserStatus(token) async { - GifLoaderDialogUtils.showMyDialog(context); + //GifLoaderDialogUtils.showMyDialog(context); authService .selectDeviceImei(token) .then((SelectDeviceIMEIRES value) => setUserValues(value)) .catchError((err) { - GifLoaderDialogUtils.hideDialog(context); + //GifLoaderDialogUtils.hideDialog(context); }); } @@ -543,6 +543,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { void setUserValues(value) async { GifLoaderDialogUtils.hideDialog(context); + requestPermissions(); sharedPref.setObject(IMEI_USER_DATA, value); } diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 3476435b..d4e6dd22 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -160,8 +160,7 @@ class AuthProvider with ChangeNotifier { }, body: request); return Future.value(localRes); } catch (error) { - print(error); - //throw error; + return Future.value(null); } } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 24afde74..3a80c598 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -70,7 +70,7 @@ class _AppDrawerState extends State { padding: EdgeInsets.zero, children: [ Container( - height: SizeConfig.screenHeight * .28, + height: SizeConfig.screenHeight * .30, padding: EdgeInsets.all(15), child: InkWell( child: Column(