|
|
|
@ -111,8 +111,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
|
|
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
|
|
|
super.didChangeAppLifecycleState(state);
|
|
|
|
super.didChangeAppLifecycleState(state);
|
|
|
|
@ -164,9 +162,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
WidgetsBinding.instance.addObserver(this);
|
|
|
|
WidgetsBinding.instance.addObserver(this);
|
|
|
|
//setState(() {
|
|
|
|
|
|
|
|
AppGlobal.context = context;
|
|
|
|
AppGlobal.context = context;
|
|
|
|
// });
|
|
|
|
|
|
|
|
_requestIOSPermissions();
|
|
|
|
_requestIOSPermissions();
|
|
|
|
pageController = PageController(keepPage: true);
|
|
|
|
pageController = PageController(keepPage: true);
|
|
|
|
_firebaseMessaging.setAutoInitEnabled(true);
|
|
|
|
_firebaseMessaging.setAutoInitEnabled(true);
|
|
|
|
@ -196,6 +194,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
if (token != null && DEVICE_TOKEN == "") {
|
|
|
|
if (token != null && DEVICE_TOKEN == "") {
|
|
|
|
DEVICE_TOKEN = token;
|
|
|
|
DEVICE_TOKEN = token;
|
|
|
|
checkUserStatus(token);
|
|
|
|
checkUserStatus(token);
|
|
|
|
|
|
|
|
if (projectViewModel.isLogin)
|
|
|
|
|
|
|
|
this.getNotificationCount(DEVICE_TOKEN);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (results[Permission.location].isGranted) ;
|
|
|
|
if (results[Permission.location].isGranted) ;
|
|
|
|
@ -420,7 +420,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
authService
|
|
|
|
authService
|
|
|
|
.selectDeviceImei(DEVICE_TOKEN)
|
|
|
|
.selectDeviceImei(DEVICE_TOKEN)
|
|
|
|
.then((SelectDeviceIMEIRES value) {
|
|
|
|
.then((SelectDeviceIMEIRES value) {
|
|
|
|
this.getNotificationCount(DEVICE_TOKEN);
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
if (value != null) {
|
|
|
|
if (value != null) {
|
|
|
|
setUserValues(value);
|
|
|
|
setUserValues(value);
|
|
|
|
@ -444,10 +443,12 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
var data =
|
|
|
|
var data =
|
|
|
|
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
if (data != null) {
|
|
|
|
if (data != null) {
|
|
|
|
authService
|
|
|
|
// authService
|
|
|
|
.registeredAuthenticatedUser(data, token, 0, 0)
|
|
|
|
// .registeredAuthenticatedUser(data, token, 0, 0)
|
|
|
|
.then((res) => {print(res)});
|
|
|
|
// .then((res) => {print(res)});
|
|
|
|
authService.getDashboard().then((value) => {
|
|
|
|
authService.getDashboard().then((value) => {
|
|
|
|
|
|
|
|
if (value != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
notificationCount = value['List_PatientDashboard'][0]
|
|
|
|
notificationCount = value['List_PatientDashboard'][0]
|
|
|
|
['UnreadPatientNotificationCount'] >
|
|
|
|
['UnreadPatientNotificationCount'] >
|
|
|
|
@ -459,8 +460,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
|
|
|
|
|
|
|
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
|
|
|
|
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
familyFileProvider.getSharedRecordByStatus();
|
|
|
|
|
|
|
|
|
|
|
|
// familyFileProvider.getSharedRecordByStatus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|