diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index e80d1e83..8fde2166 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -44,27 +44,26 @@ class BaseAppClient { ? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA : PATIENT_OUT_SA; - // if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; - // } + if (body.containsKey('isDentalAllowedBackend')) { + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; + } body['DeviceTypeID'] = DeviceTypeID; - // if (body.containsKey('PatientType')) { - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE - : PATIENT_TYPE; - // } + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + : PATIENT_TYPE; - // if (body.containsKey('PatientTypeID')) { - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; - // } + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; if (user != null) { body['TokenID'] = token; diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 8076554e..dc6fc65c 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -17,10 +17,8 @@ class MyAppointments extends StatefulWidget { List arrivedAppoList = []; List _patientBookedAppointmentListHospital = List(); - List _patientConfirmedAppointmentListHospital = List(); - List _patientArrivedAppointmentListHospital = List(); @override @@ -101,6 +99,8 @@ class _MyAppointmentsState extends State } }).catchError((err) { print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); }).showProgressBar( text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } @@ -204,11 +204,11 @@ class _MyAppointmentsState extends State } openAppointmentsTab() { - if (widget.bookedAppoList.length != 0) { + if (widget._patientBookedAppointmentListHospital.length != 0) { _tabController.index = 0; - } else if (widget.confirmedAppoList.length != 0) { + } else if (widget._patientConfirmedAppointmentListHospital.length != 0) { _tabController.index = 1; - } else if (widget.arrivedAppoList.length != 0) { + } else if (widget._patientArrivedAppointmentListHospital.length != 0) { _tabController.index = 2; return; } @@ -385,17 +385,6 @@ class _MyAppointmentsState extends State ), ), ) -// Container( -// child: new ListView.builder( -// itemCount: widget.arrivedAppoList.length, -// itemBuilder: (context, i) { -// return AppointmentCard( -// appo: widget.arrivedAppoList[i], -// onReloadAppointmentHistory: getPatientAppointmentHistory, -// ); -// }, -// ), -// ) : Container( child: Center( child: Column( diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index 4a288730..a89253c6 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -25,7 +25,7 @@ class ArrivedButtons { "title": "Lab", "subtitle": "Result", "icon": "assets/images/new-design/lab_result_icon.png", - "caller": "addReminder" + "caller": "labResult" }, { "title": "Vital Signs", diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index a876160f..19e82086 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -12,17 +12,18 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButton import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; class AppointmentActions extends StatefulWidget { @@ -189,6 +190,10 @@ class _AppointmentActionsState extends State { case "VitalSigns": navigateToVitalSigns(widget.appo.appointmentNo, widget.appo.projectID); break; + + case "insertComplaint": + navigateToInsertComplaint(); + break; } } @@ -357,7 +362,8 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } openAppointmentRadiology() { @@ -374,7 +380,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } openPrescriptionReport() { @@ -394,7 +401,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToMedicinePrescriptionReport( @@ -460,7 +468,10 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + AppToast.showErrorToast( + message: err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getCallRequestType() { @@ -475,7 +486,8 @@ class _AppointmentActionsState extends State { }); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } showAskDocRequestDialog(List requestData) { @@ -520,7 +532,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } confirmAppointment() { @@ -537,7 +550,8 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } navigateToInsuranceApprovals(int appoNo) { @@ -547,7 +561,14 @@ class _AppointmentActionsState extends State { navigateToVitalSigns(int appoNo, int projectID) { Navigator.push( - context, FadePage(page: VitalSignDetailsScreen(appointmentNo: appoNo, projectID: projectID))); + context, + FadePage( + page: VitalSignDetailsScreen( + appointmentNo: appoNo, projectID: projectID))); + } + + navigateToInsertComplaint() { + Navigator.push(context, FadePage(page: FeedbackHomePage())); } rateAppointment() {