Merge branch 'sultan' into 'diplomatic-quarter-live'

Sultan

See merge request Cloud_Solution/diplomatic-quarter!195
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit d8134240de

@ -151,17 +151,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
Future.delayed(Duration.zero, () async {
if (token != null && await sharedPref.getObject(USER_PROFILE) == null) { if (token != null && await sharedPref.getObject(USER_PROFILE) == null) {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
} else { } else if (await sharedPref.getObject(USER_PROFILE) != null) {
getNotificationCount(token); getNotificationCount(token);
} }
requestPermissions();
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}); });
});
// //
// //_firebase Background message handler // //_firebase Background message handler
Future.delayed(Duration.zero, () => setTheme()); Future.delayed(Duration.zero, () => setTheme());
@ -516,12 +516,12 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// themeNotifier.setTheme(defaultTheme); // themeNotifier.setTheme(defaultTheme);
} }
void checkUserStatus(token) async { void checkUserStatus(token) async {
GifLoaderDialogUtils.showMyDialog(context); //GifLoaderDialogUtils.showMyDialog(context);
authService authService
.selectDeviceImei(token) .selectDeviceImei(token)
.then((SelectDeviceIMEIRES value) => setUserValues(value)) .then((SelectDeviceIMEIRES value) => setUserValues(value))
.catchError((err) { .catchError((err) {
GifLoaderDialogUtils.hideDialog(context); //GifLoaderDialogUtils.hideDialog(context);
}); });
} }
@ -543,6 +543,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void setUserValues(value) async { void setUserValues(value) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
requestPermissions();
sharedPref.setObject(IMEI_USER_DATA, value); sharedPref.setObject(IMEI_USER_DATA, value);
} }

@ -160,8 +160,7 @@ class AuthProvider with ChangeNotifier {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); return Future.value(null);
//throw error;
} }
} }

@ -70,7 +70,7 @@ class _AppDrawerState extends State<AppDrawer> {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: <Widget>[ children: <Widget>[
Container( Container(
height: SizeConfig.screenHeight * .28, height: SizeConfig.screenHeight * .30,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: InkWell( child: InkWell(
child: Column( child: Column(

Loading…
Cancel
Save