From 8e7786cb969bb1f909374d778d92f4dcec5c1016 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 6 Sep 2021 12:27:52 +0300 Subject: [PATCH] updates & fixes --- .../MyAppointments/AppointmentDetails.dart | 3 +- lib/pages/MyAppointments/SchedulePage.dart | 2 + .../widgets/AppointmentActions.dart | 148 ++---------------- .../appointment_services/GetDoctorsList.dart | 4 +- 4 files changed, 22 insertions(+), 135 deletions(-) diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index ec658c67..2c8083f8 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -533,8 +533,7 @@ class _AppointmentDetailsState extends State with SingleTick setTab() async { var scheduleDoctor = await sharedPref.getObject(DOCTOR_SCHEDULE_DATE_SEL); - - widget.appo.appointmentDate = scheduleDoctor['Date']; + if (scheduleDoctor != null) widget.appo.appointmentDate = scheduleDoctor['Date']; } confirmAppointment() { diff --git a/lib/pages/MyAppointments/SchedulePage.dart b/lib/pages/MyAppointments/SchedulePage.dart index ef53ab04..10b52f10 100644 --- a/lib/pages/MyAppointments/SchedulePage.dart +++ b/lib/pages/MyAppointments/SchedulePage.dart @@ -64,6 +64,8 @@ class _SchedulePageState extends State { } return AppScaffold( appBarTitle: TranslationBase.of(context).schedule, + showNewAppBar: true, + showNewAppBarTitle: true, isShowAppBar: true, baseViewModel: model2, isShowDecPage: false, diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 6fd63f56..0b70d91f 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; @@ -7,7 +6,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart'; - import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; @@ -17,23 +15,17 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButton import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart'; 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/labs/laboratory_result_page.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/services/clinic_services/get_clinic_service.dart'; -import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.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'; @@ -74,86 +66,25 @@ class _AppointmentActionsState extends State { padding: EdgeInsets.all(21), shrinkWrap: true, itemBuilder: (context, index) { + bool shouldEnable = (widget.appo.clinicID == 17 && appoButtonsList[index].caller == "openReschedule"); return InkWell( - onTap: () { - _handleButtonClicks(appoButtonsList[index]); - }, + onTap: shouldEnable + ? null + : () { + _handleButtonClicks(appoButtonsList[index]); + }, child: MedicalProfileItem( title: appoButtonsList[index].title, imagePath: appoButtonsList[index].icon, subTitle: appoButtonsList[index].subtitle, hasBadge: true, - isEnable: projectViewModel.havePrivilege(5), + isEnable: !shouldEnable, imgColor: Color(0xff28323A), ), ); }, itemCount: appoButtonsList.length, ); - - return Container( - margin: EdgeInsets.all(5.0), - child: CustomScrollView( - primary: false, - physics: NeverScrollableScrollPhysics(), - slivers: [ - SliverPadding( - padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), - sliver: SliverGrid.count( - crossAxisCount: 2, - childAspectRatio: (itemWidth / itemHeight), - children: appoButtonsList - .map((e) => GestureDetector( - onTap: () { - _handleButtonClicks(e); - }, - child: Container( - margin: EdgeInsets.all(8.0), - padding: EdgeInsets.only(bottom: 4.0), - decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white), - child: Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Container( - margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 5.0), - child: Texts( - e.title, - color: Color(0xffB8382C), - variant: "overline", - fontSize: SizeConfig.textMultiplier * 1.8, - ), - ), - Container( - margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), - child: Texts( - e.subtitle, - color: Colors.black, - variant: "overline", - fontSize: SizeConfig.textMultiplier * 1.6, - ), - ), - ], - ), - ), - Container( - alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, - margin: projectViewModel.isArabic ? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0) : EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0), - child: Image.asset(e.icon, width: 40.0, height: 40.0), - ), - ], - ), - ), - )) - .toList(), - ), - ), - ], - ), - ); } _handleButtonClicks(AppoDetailsButton) { @@ -164,28 +95,10 @@ class _AppointmentActionsState extends State { widget.enableFooterButton(); }); break; - - // case "onCancelAppointment": - // ConfirmDialog dialog = new ConfirmDialog( - // context: context, - // confirmMessage: TranslationBase.of(context).cancelAppoMsg, - // okText: TranslationBase.of(context).confirm, - // cancelText: TranslationBase.of(context).cancel_nocaps, - // okFunction: () => {cancelAppointment()}, - // cancelFunction: () => {}); - // dialog.showAlertDialog(context); - // break; - - // case "confirmAppointment": - // confirmAppointment(); - // break; - case "navigateToProject": openMap(double.parse(widget.appo.latitude), double.parse(widget.appo.longitude)); break; - case "addReminder": - // showReminderDialog(widget.appo); showReminderDialog( context, DateUtil.convertStringToDate(widget.appo.appointmentDate), @@ -198,31 +111,24 @@ class _AppointmentActionsState extends State { }, ); break; - case "goToTodoList": Navigator.of(context).pop(); break; - case "askDoc": askYourDoc(); break; - case "radiology": openAppointmentRadiology(); break; - case "labResult": openAppointmentLabResults(); break; - case "prescriptions": openPrescriptionReport(); break; - case "Survey": rateAppointment(); break; - case "Insurance": navigateToInsuranceApprovals(widget.appo.appointmentNo); break; @@ -438,7 +344,17 @@ class _AppointmentActionsState extends State { patientLabOrders.orderNo = res['ListLabResultsByAppNo'][0]['OrderNo'].toString(); patientLabOrders.invoiceNo = res['ListLabResultsByAppNo'][0]['InvoiceNo'].toString(); patientLabOrders.clinicID = widget.appo.clinicID; + patientLabOrders.clinicDescription = widget.appo.clinicName; patientLabOrders.projectID = widget.appo.projectID.toString(); + patientLabOrders.doctorName = widget.appo.doctorNameObj; + patientLabOrders.doctorImageURL = widget.appo.doctorImageURL; + patientLabOrders.speciality = widget.appo.doctorSpeciality; + patientLabOrders.projectName = widget.appo.projectName; + patientLabOrders.orderDate = DateUtil.convertStringToDate(widget.appo.appointmentDate); + patientLabOrders.doctorRate = widget.appo.doctorRate; + patientLabOrders.actualDoctorRate = widget.appo.actualDoctorRate; + patientLabOrders.noOfPatientsRate = widget.appo.noOfPatientsRate; + print(patientLabOrders.invoiceNo); print(patientLabOrders.orderNo); navigateToLabResults(patientLabOrders); @@ -516,36 +432,6 @@ class _AppointmentActionsState extends State { } } - // showReminderDialog(AppoitmentAllHistoryResultList appo) { - // - // - // //old reminder dialog having location - // showGeneralDialog( - // barrierColor: Colors.black.withOpacity(0.5), - // transitionBuilder: (context, a1, a2, widget) { - // final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; - // return Transform( - // transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), - // child: Opacity( - // opacity: a1.value, - // child: ReminderDialog( - // eventId: appo.appointmentNo.toString(), - // title: "Doctor Appointment", - // description: "You have an appointment with " + appo.doctorTitle + " " + appo.doctorNameObj, - // startDate: appo.appointmentDate, - // endDate: appo.appointmentDate, - // location: appo.projectName, - // ), - // ), - // ); - // }, - // transitionDuration: Duration(milliseconds: 500), - // barrierDismissible: true, - // barrierLabel: '', - // context: context, - // pageBuilder: (context, animation1, animation2) {}); - // } - askYourDoc() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 40b7059d..cee36817 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -130,8 +130,8 @@ class DoctorsListService extends BaseService { "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, - "Latitude": lat, - "Longitude": long, + "Latitude": lat == null ? 0.0 : lat, + "Longitude": long == null ? 0.0 : long, "License": true };