Next Actions handled when navigating from My Appointments to ToDo list

dev_3.3_faiz_payfort
haroon amjad 2 years ago
parent b579e494c1
commit 5c8bb241b3

@ -588,14 +588,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) {
if (widget.projectViewModel.isLogin) {
if (model.count != 0) {
Navigator.push(
context,
FadePage(
page: ToDo(
isShowAppBar: true,
isFromMyAppointments: true,
appointment: widget.appo,
)));
getPatientAppointmentHistoryWithAppo();
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
}
@ -611,6 +604,33 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
}
getPatientAppointmentHistoryWithAppo() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]);
Navigator.push(
context,
FadePage(
page: ToDo(
isShowAppBar: true,
isFromMyAppointments: true,
appointment: appo,
),
),
);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
err != null ?? AppToast.showErrorToast(message: err);
});
}
rateAppointment() {
widget.browser = new MyInAppBrowser();
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';

@ -548,6 +548,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
case 10:
confirmAppointment(appo);
break;
case 15:
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingPaymentPending);
break;
case 20:
getPatientShare(context, appo);
// checkPatientNphiesEligibility(context, appo);
@ -836,7 +839,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
dataLoaded = true;
if (widget.isFromMyAppointments) {
getPatientShare(context, widget.appointment);
performNextAction(widget.appointment);
widget.isFromMyAppointments = false;
}
});
} else {

@ -614,6 +614,19 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistoryWithAppoNo(int appoNo) async {
Map<String, dynamic> request;
request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async {
Map<String, dynamic> request;
@ -1843,6 +1856,4 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
}

Loading…
Cancel
Save