|
|
|
|
@ -645,35 +645,31 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
if (data != null) {
|
|
|
|
|
authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {});
|
|
|
|
|
authService.getDashboard().then((value) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (value != null) {
|
|
|
|
|
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
|
|
|
|
|
model.setState(model.count, true, notificationCount);
|
|
|
|
|
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
|
|
|
|
|
FlutterAppIconBadge.updateBadge(num.parse(notificationCount));
|
|
|
|
|
|
|
|
|
|
appointmentRateViewModel
|
|
|
|
|
.getIsLastAppointmentRatedList()
|
|
|
|
|
.then((value) => {
|
|
|
|
|
// getToDoCount(),
|
|
|
|
|
// GifLoaderDialogUtils.hideDialog(AppGlobal.context),
|
|
|
|
|
if (appointmentRateViewModel.isHaveAppointmentNotRate)
|
|
|
|
|
{
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: RateAppointmentDoctor(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
authService.getDashboard().then((value) async {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (value != null) {
|
|
|
|
|
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
|
|
|
|
|
model.setState(model.count, true, notificationCount);
|
|
|
|
|
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
|
|
|
|
|
FlutterAppIconBadge.updateBadge(num.parse(notificationCount));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) {
|
|
|
|
|
appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) async {
|
|
|
|
|
if (appointmentRateViewModel.isHaveAppointmentNotRate) {
|
|
|
|
|
await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: RateAppointmentDoctor(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
projectViewModel.analytics.setUser(data);
|
|
|
|
|
} else {
|
|
|
|
|
|