diff --git a/lib/core/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart index e909bbda..6c17a750 100644 --- a/lib/core/service/AlHabibMedicalService/H2O_service.dart +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; class H2OService extends BaseService { List userProgressForTodayDataList = []; - List userProgressForWeekDataList =[]; + List userProgressForWeekDataList = []; List userProgressForMonthDataList = []; UserProgressRequestModel userProgressRequestModel = UserProgressRequestModel(); @@ -23,7 +23,11 @@ class H2OService extends BaseService { hasError = false; await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) { - userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]); + if (response["UserDetailData_New"] != null) { + userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]); + } else { + userDetailModel = UserDetailModel(); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index c94abaf6..4def8cb1 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -28,7 +28,8 @@ class CMCService extends BaseService { hasError = false; // RC IMPLEMENTATION - await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + authenticatedUserObject.user.patientID.toString(), isRCService: true, isAllowAny: true, + onSuccess: (dynamic response, int statusCode) { cmcAllServicesList.clear(); response['response'].forEach((data) { cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 15d4e8cb..de81df4c 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -6,15 +6,12 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart'; import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart'; -import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; -import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; @@ -34,7 +31,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class AnicllaryOrdersDetails extends StatefulWidget { final dynamic appoNo; @@ -51,7 +47,7 @@ class _AnicllaryOrdersState extends State with SingleTic late ProjectViewModel projectViewModel; bool _agreeTerms = false; String selectedPaymentMethod = ""; - MyInAppBrowser? browser; + late MyInAppBrowser browser; String transID = ""; late BuildContext localContext; String? selectedInstallmentPlan; @@ -483,7 +479,6 @@ class _AnicllaryOrdersState extends State with SingleTic return total.toStringAsFixed(2); } - bool checkIfProcedureSelected(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { if (selectedProcList.length > 0) { if (selectedProcList.contains(ancillaryOrderProcDetailsList)) { @@ -495,6 +490,7 @@ class _AnicllaryOrdersState extends State with SingleTic return false; } } + bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { if ((ancillaryOrderProcDetailsList.isApprovalRequired! && !ancillaryOrderProcDetailsList.isApprovalCreated!) || (ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0) || @@ -504,6 +500,7 @@ class _AnicllaryOrdersState extends State with SingleTic return false; } } + addToSelectedProcedures() { if (_ancillaryProcLists.isNotEmpty) { selectedProcList.clear(); @@ -594,10 +591,10 @@ class _AnicllaryOrdersState extends State with SingleTic if (projectViewModel.havePrivilege(103)) { startApplePay(); } else { - openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); + openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan); } } else { - openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); + openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan); } }, patientShare: double.parse(getTotalValue()), @@ -693,7 +690,7 @@ class _AnicllaryOrdersState extends State with SingleTic browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!); - browser!.openPaymentBrowser( + browser.openPaymentBrowser( amount, "Ancillary Orders Payment", transID, @@ -704,7 +701,7 @@ class _AnicllaryOrdersState extends State with SingleTic projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.patientID, authenticatedUser, - browser!, + browser, false, "3", // Need to get new Service ID from Ayman for Ancillary Tamara @@ -735,7 +732,7 @@ class _AnicllaryOrdersState extends State with SingleTic MyInAppBrowser.successURLS.forEach((element) { if (url.contains(element)) { - if (browser!.isOpened()) browser!.close(); + if (browser.isOpened()) browser.close(); MyInAppBrowser.isPaymentDone = true; return; } @@ -743,7 +740,7 @@ class _AnicllaryOrdersState extends State with SingleTic MyInAppBrowser.errorURLS.forEach((element) { if (url.contains(element)) { - if (browser!.isOpened()) browser!.close(); + if (browser.isOpened()) browser.close(); MyInAppBrowser.isPaymentDone = false; return; } @@ -881,8 +878,4 @@ class _AnicllaryOrdersState extends State with SingleTic Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); }).showAlertDialog(context); } - - - - } diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index c33c345e..80df166e 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -31,7 +31,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:provider/provider.dart'; import '../../config/shared_pref_kay.dart'; @@ -42,7 +41,7 @@ class BookSuccess extends StatefulWidget { DoctorList docObject; late MyInAppBrowser browser; - final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); + // final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); String appoDateFormatted; String appoTimeFormatted; @@ -70,9 +69,7 @@ class _BookSuccessState extends State { initState() { WidgetsBinding.instance.addPostFrameCallback((_) async { if (widget.patientShareResponse.isLiveCareAppointment! && - (widget.patientShareResponse.patientShareWithTax.toString() == "0" || - widget.patientShareResponse.patientShareWithTax.toString() == - "0.0")) { + (widget.patientShareResponse.patientShareWithTax.toString() == "0" || widget.patientShareResponse.patientShareWithTax.toString() == "0.0")) { setOnlineCheckInForAppointment(); } }); @@ -116,26 +113,18 @@ class _BookSuccessState extends State { alignment: Alignment.center, color: CustomColors.green, child: Table( - border: TableBorder(verticalInside: BorderSide( - width: 0.5, color: Colors.white)), + border: TableBorder(verticalInside: BorderSide(width: 0.5, color: Colors.white)), children: [ TableRow( children: [ - TableCell(child: _getNormalText(TranslationBase - .of(context) - .patientShare)), - TableCell(child: _getNormalText(TranslationBase - .of(context) - .patientShareWithTax)), + TableCell(child: _getNormalText(TranslationBase.of(context).patientShare)), + TableCell(child: _getNormalText(TranslationBase.of(context).patientShareWithTax)), ], ), TableRow( children: [ - TableCell(child: _getHeadingText("SR " + - widget.patientShareResponse.patientShare.toString())), - TableCell(child: _getHeadingText("SR " + - widget.patientShareResponse.patientShareWithTax - .toString())), + TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShare.toString())), + TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShareWithTax.toString())), ], ), ], @@ -178,10 +167,7 @@ class _BookSuccessState extends State { return Container( alignment: Alignment.bottomCenter, margin: EdgeInsets.all(14), - height: MediaQuery - .of(context) - .size - .height * 0.18, + height: MediaQuery.of(context).size.height * 0.18, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -193,10 +179,7 @@ class _BookSuccessState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: MediaQuery - .of(context) - .size - .width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: CustomTextButton( backgroundColor: CustomColors.green, @@ -205,10 +188,7 @@ class _BookSuccessState extends State { GifLoaderDialogUtils.showMyDialog(context); getAppoQR(context); }, - child: Text(TranslationBase - .of(context) - .checkinOptions, - style: TextStyle(fontSize: 18.0, color: Colors.white)), + child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)), ), ), ), @@ -219,10 +199,7 @@ class _BookSuccessState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: MediaQuery - .of(context) - .size - .width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: CustomTextButton( backgroundColor: Color(0xffc5272d), @@ -232,10 +209,7 @@ class _BookSuccessState extends State { // GifLoaderDialogUtils.showMyDialog(context); // getAppoQR(context); }, - child: Text(TranslationBase - .of(context) - .done, - style: TextStyle(fontSize: 18.0, color: Colors.white)), + child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)), ), ), ), @@ -270,16 +244,9 @@ class _BookSuccessState extends State { elevation: 0, onPressed: () { startPaymentProcess(); - projectViewModel.analytics.appointment - .pay_now_for_appointment( - appointment_type: 'regular', - doctorDetail: widget.docObject, - payNow: true); + projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true); }, - child: Text(TranslationBase - .of(context) - .payNow - .toUpperCase(), + child: Text(TranslationBase.of(context).payNow.toUpperCase(), style: TextStyle( fontSize: 18.0, color: Colors.white, @@ -300,17 +267,9 @@ class _BookSuccessState extends State { elevation: 0, onPressed: () { navigateToHome(context); - projectViewModel.analytics.appointment - .pay_now_for_appointment( - appointment_type: 'regular', - doctorDetail: widget.docObject, - payNow: false); + projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false); }, - child: Text(TranslationBase - .of(context) - .payLater - .toUpperCase(), style: TextStyle( - fontSize: 18.0, color: Colors.white)), + child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), ), ), ), @@ -318,37 +277,33 @@ class _BookSuccessState extends State { ), widget.isCash ? Column( - children: [ - mHeight(10.0), - Text( - TranslationBase - .of(context) - .cashAmountUpdateInsurance, - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - ), - ), - mHeight(5.0), - DefaultButton( - TranslationBase - .of(context) - .updateInsuranceText, - () { - Navigator.pop(context, null); - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute(builder: (context) => LandingPage()), - (Route route) => false, - ); - Navigator.push(context, FadePage(page: InsuranceUpdate())); - }, - color: Color(0xffEAA118), - textColor: Colors.white, - ), - ], - ) + children: [ + mHeight(10.0), + Text( + TranslationBase.of(context).cashAmountUpdateInsurance, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + ), + ), + mHeight(5.0), + DefaultButton( + TranslationBase.of(context).updateInsuranceText, + () { + Navigator.pop(context, null); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + color: Color(0xffEAA118), + textColor: Colors.white, + ), + ], + ) : Container(), ], ), @@ -380,23 +335,17 @@ class _BookSuccessState extends State { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; - appo.appointmentNo = - widget.patientShareResponse.appointmentNo; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; - appo.appointmentDate = - widget.patientShareResponse.appointmentDate; + appo.appointmentDate = widget.patientShareResponse.appointmentDate; if (appo.isLiveCareAppointment!) insertLiveCareVIDARequest(appo); else navigateToHome(context); }, - child: Text(TranslationBase - .of(context) - .confirmLater, - style: TextStyle(fontSize: 16.0, color: Colors.white)), + child: Text(TranslationBase.of(context).confirmLater, style: TextStyle(fontSize: 16.0, color: Colors.white)), ), ), ), @@ -415,11 +364,9 @@ class _BookSuccessState extends State { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; - appo.appointmentNo = - widget.patientShareResponse.appointmentNo; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; if (appo.isLiveCareAppointment!) { navigateToHome(context); @@ -427,13 +374,7 @@ class _BookSuccessState extends State { confirmAppointment(appo); } }, - child: Text(widget.patientShareResponse.isLiveCareAppointment! - ? TranslationBase - .of(context) - .confirmLiveCare - : TranslationBase - .of(context) - .confirm, + child: Text(widget.patientShareResponse.isLiveCareAppointment! ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm, style: TextStyle(fontSize: 16.0, color: Colors.white)), ), ), @@ -503,10 +444,7 @@ class _BookSuccessState extends State { Container( margin: EdgeInsets.only(top: 30.0, bottom: 40.0), alignment: Alignment.center, - child: Text(TranslationBase - .of(context) - .confirmAppo, - style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), + child: Text(TranslationBase.of(context).confirmAppo, style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), ), Flex( direction: Axis.horizontal, @@ -520,14 +458,8 @@ class _BookSuccessState extends State { children: [ _getBulletPoint("1"), Container( - width: MediaQuery - .of(context) - .size - .width * 0.8, - child: Text(TranslationBase - .of(context) - .upcomingConfirm, overflow: TextOverflow.clip, - style: TextStyle(fontSize: 13.0)), + width: MediaQuery.of(context).size.width * 0.8, + child: Text(TranslationBase.of(context).upcomingConfirm, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), ], ), @@ -547,14 +479,8 @@ class _BookSuccessState extends State { children: [ _getBulletPoint("2"), Container( - width: MediaQuery - .of(context) - .size - .width * 0.8, - child: Text(TranslationBase - .of(context) - .upcomingConfirmMore, overflow: TextOverflow.clip, - style: TextStyle(fontSize: 13.0)), + width: MediaQuery.of(context).size.width * 0.8, + child: Text(TranslationBase.of(context).upcomingConfirmMore, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), ], ), @@ -562,8 +488,7 @@ class _BookSuccessState extends State { ), ], ), - Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), - child: getPaymentMethods()), + Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), child: getPaymentMethods()), ], ); } @@ -575,17 +500,13 @@ class _BookSuccessState extends State { setOnlineCheckInForAppointment() { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.setOnlineCheckInForAppointment( - widget.patientShareResponse.appointmentNo.toString(), - widget.patientShareResponse.projectID!, - projectViewModel.isArabic ? 1 : 2, context).then((res) { + service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID!, projectViewModel.isArabic ? 1 : 2, context).then((res) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; appo.appointmentDate = widget.patientShareResponse.appointmentDate; insertLiveCareVIDARequest(appo, isMoveHome: false); @@ -600,9 +521,7 @@ class _BookSuccessState extends State { confirmAppointment(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.confirmAppointment( - appo.appointmentNo!, appo.clinicID!, appo.projectID!, - appo.isLiveCareAppointment!, context).then((res) { + service.confirmAppointment(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.isLiveCareAppointment!, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); @@ -621,22 +540,12 @@ class _BookSuccessState extends State { }); } - insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, - {bool isMoveHome = true}) { + insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, {bool isMoveHome = true}) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); service - .insertVIDARequest( - appo.appointmentNo, - appo.clinicID, - appo.projectID, - appo.serviceID, - appo.doctorID, - appo.appointmentDate!, - Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo), - projectViewModel.isArabic ? 1 : 2, - context) + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { @@ -659,9 +568,7 @@ class _BookSuccessState extends State { mainAxisSize: MainAxisSize.max, children: [ Text( - TranslationBase - .of(context) - .payNowBookSuccess, + TranslationBase.of(context).payNowBookSuccess, style: TextStyle( fontSize: 24.0, letterSpacing: -1.44, @@ -669,9 +576,7 @@ class _BookSuccessState extends State { ), ), Text( - TranslationBase - .of(context) - .neverWait, + TranslationBase.of(context).neverWait, style: TextStyle( fontSize: 12.0, letterSpacing: -0.54, @@ -679,20 +584,15 @@ class _BookSuccessState extends State { ), ), mHeight(24), - Text(TranslationBase - .of(context) - .payNowBookSuccesstext1, + Text(TranslationBase.of(context).payNowBookSuccesstext1, overflow: TextOverflow.fade, style: TextStyle( fontSize: 12.0, letterSpacing: -0.36, )), - Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: getPaymentMethods()), + Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), Text( - TranslationBase - .of(context) - .payNowBookSuccesstext2, + TranslationBase.of(context).payNowBookSuccesstext2, overflow: TextOverflow.clip, style: TextStyle( fontSize: 12.0, @@ -708,29 +608,26 @@ class _BookSuccessState extends State { navigateToPaymentMethod(context, widget.patientShareResponse); } - Future navigateToPaymentMethod(context, - PatientShareResponse patientShareResponse) async { + Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = widget.patientShareResponse.projectID; appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicName = widget.patientShareResponse.clinicName; appo.projectName = widget.patientShareResponse.projectName; appo.appointmentNo = widget.patientShareResponse.appointmentNo; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; appo.appointmentDate = widget.patientShareResponse.appointmentDate; appo.serviceID = widget.patientShareResponse.serviceID; Navigator.push( - context, - FadePage( - page: PaymentMethod( - onSelectedMethod: (String metohd, - [String? selectedInstallmentPlan]) { - setState(() {}); - }, - patientShare: widget.patientShareResponse.patientShareWithTax))) + context, + FadePage( + page: PaymentMethod( + onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) { + setState(() {}); + }, + patientShare: widget.patientShareResponse.patientShareWithTax))) .then((value) { selectedPaymentMethod = value[0]; if (value != null) { @@ -748,10 +645,8 @@ class _BookSuccessState extends State { }); } - void startApplePay(AppoitmentAllHistoryResultList appo, - PatientShareResponse patientShareResponse) async { - transID = Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo); + void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async { + transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); print("TransactionID: $transID"); GifLoaderDialogUtils.showMyDialog(context); @@ -759,10 +654,7 @@ class _BookSuccessState extends State { ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest(); PayfortProjectDetailsRespModel? payfortProjectDetailsRespModel; - await context.read() - .getProjectDetailsForPayfort(projectId: appo.projectID, - serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()) - .then((value) { + await context.read().getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()).then((value) { payfortProjectDetailsRespModel = value!; }); @@ -788,8 +680,7 @@ class _BookSuccessState extends State { applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.longitude = "0.0"; - applePayInsertRequest.amount = - patientShareResponse.patientShareWithTax.toString(); + applePayInsertRequest.amount = patientShareResponse.patientShareWithTax.toString(); applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0"; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; @@ -800,20 +691,15 @@ class _BookSuccessState extends State { applePayInsertRequest.isMobSDK = true; applePayInsertRequest.merchantReference = transID; - applePayInsertRequest.merchantIdentifier = - payfortProjectDetailsRespModel!.merchantIdentifier!; + applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel!.merchantIdentifier!; applePayInsertRequest.commandType = "PURCHASE"; applePayInsertRequest.signature = payfortProjectDetailsRespModel!.signature; - applePayInsertRequest.accessCode = - payfortProjectDetailsRespModel!.accessCode; - applePayInsertRequest.shaRequestPhrase = - payfortProjectDetailsRespModel!.shaRequest; - applePayInsertRequest.shaResponsePhrase = - payfortProjectDetailsRespModel!.shaResponse; + applePayInsertRequest.accessCode = payfortProjectDetailsRespModel!.accessCode; + applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel!.shaRequest; + applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel!.shaResponse; applePayInsertRequest.returnURL = ""; - service.applePayInsertRequest(applePayInsertRequest, context).then(( - res) async { + service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { await context.read().initiateApplePayWithPayfort( customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, @@ -842,7 +728,6 @@ class _BookSuccessState extends State { }); } - openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); selectedPaymentMethod = paymentMethod[0]; @@ -1274,7 +1159,7 @@ class _BookSuccessState extends State { ); } -_getTextStyling() { - return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7); -} + _getTextStyling() { + return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7); + } } diff --git a/lib/pages/BookAppointment/book_reminder_page.dart b/lib/pages/BookAppointment/book_reminder_page.dart index 56c48589..547ab901 100644 --- a/lib/pages/BookAppointment/book_reminder_page.dart +++ b/lib/pages/BookAppointment/book_reminder_page.dart @@ -1,6 +1,5 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; @@ -15,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; @@ -39,7 +37,7 @@ class BookReminderPage extends StatefulWidget { class _BookReminderPageState extends State { late MyInAppBrowser browser; - final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); + // final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); String? selectedTime; bool isSuccessShow = true; @@ -84,7 +82,7 @@ class _BookReminderPageState extends State { null, null, widget.docObject.nationalityFlagURL ?? "", - widget.docObject.doctorRate?? 0, + widget.docObject.doctorRate ?? 0, null, widget.docObject.noOfPatientsRate ?? 0, "", @@ -189,20 +187,11 @@ class _BookReminderPageState extends State { backgroundColor: CustomColors.green, elevation: 0, onPressed: () async { - showReminderDialog( - context, - widget.dateTime!, - widget.docObject.name!, - widget.patientShareResponse.appointmentNo.toString(), - widget.appoDateFormatted, - widget.appoTimeFormatted, - onSuccess: () { - AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); - navigateToBookSuccess(context); - }, - title: null, - description: null - ); + showReminderDialog(context, widget.dateTime!, widget.docObject.name!, widget.patientShareResponse.appointmentNo.toString(), widget.appoDateFormatted, widget.appoTimeFormatted, + onSuccess: () { + AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); + navigateToBookSuccess(context); + }, title: null, description: null); projectViewModel.analytics.appointment.appointment_reminder(true); }, child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)), diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 09e7c40e..97cd91dd 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; @@ -35,14 +37,11 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +import 'package:huawei_map/huawei_map.dart' as hmsMap; import 'package:intl/intl.dart'; import 'package:map_launcher/map_launcher.dart'; -import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'dart:io'; -import 'package:huawei_map/huawei_map.dart' as hmsMap; - class AppointmentActions extends StatefulWidget { AppoitmentAllHistoryResultList appo; @@ -59,7 +58,7 @@ class AppointmentActions extends StatefulWidget { class _AppointmentActionsState extends State { List appoButtonsList = []; - static bool isHuawei =false; + static bool isHuawei = false; late HmsApiAvailability hmsApiAvailability; @override @@ -124,7 +123,7 @@ class _AppointmentActionsState extends State { GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE = 'my appointment'; showReminderDialog( context, - DateFormat("dd MMM yyyy hh:mm") + DateFormat("dd MMM yyyy hh:mm") .parse(DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate!), widget.projectViewModel!.isArabic) + " " + widget.appo.startTime!), //DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.appo.doctorNameObj!, @@ -466,7 +465,11 @@ class _AppointmentActionsState extends State { static Future openMap(double latitude, double longitude) async { await MapLauncher.showMarker( - mapType: Platform.isAndroid ? isHuawei == true ? MapType.petal: MapType.google : MapType.apple, + mapType: Platform.isAndroid + ? isHuawei == true + ? MapType.petal + : MapType.google + : MapType.apple, coords: Coords(latitude, longitude), title: "Sulaiman Al Habib", description: "Appointment Location", @@ -474,7 +477,7 @@ class _AppointmentActionsState extends State { } checkIsHuawei() async { - if( Platform.isAndroid) { + if (Platform.isAndroid) { await hmsApiAvailability.isHMSAvailable().then((value) { isHuawei = value == 0 ? true : false; hmsMap.HuaweiMapInitializer.initializeMap(); @@ -482,28 +485,29 @@ class _AppointmentActionsState extends State { print(isHuawei); } } + askYourDoc() { GifLoaderDialogUtils.showMyDialog(context); int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; DoctorsListService service = new DoctorsListService(); - service.isAllowedToAskDoctor(widget.appo.doctorID!,languageID, context).then((res) { - int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; - service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - print(res['PatientDoctorAppointmentResultList']); - if (res['PatientDoctorAppointmentResultList'].length != 0) { - getCallRequestType(); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed); - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - print(err); - AppToast.showErrorToast(message: err); - }); - }); + service.isAllowedToAskDoctor(widget.appo.doctorID!, languageID, context).then((res) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['PatientDoctorAppointmentResultList']); + if (res['PatientDoctorAppointmentResultList'].length != 0) { + getCallRequestType(); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed); } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + }); + } getCallRequestType() { int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; @@ -526,23 +530,22 @@ class _AppointmentActionsState extends State { showAskDocRequestDialog(List requestData) { 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: AskDocDialog(requestData: requestData), - ), - ); - }, - transitionDuration: Duration(milliseconds: 500), - barrierDismissible: true, - barrierLabel: '', - context: context, - pageBuilder: (context, animation1, animation2) =>SizedBox()) - .then((value) { + 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: AskDocDialog(requestData: requestData), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) => SizedBox()).then((value) { print("Dialog Closed"); print(value); if (value != null) { @@ -625,10 +628,10 @@ class _AppointmentActionsState extends State { context, FadePage( page: ToDo( - isShowAppBar: true, - isFromMyAppointments: true, - appointment: widget.appo, - ))); + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } } @@ -661,7 +664,7 @@ class _AppointmentActionsState extends State { } rateAppointment() { - widget.browser = new MyInAppBrowser(); + widget.browser = new MyInAppBrowser(onExitCallback: () {}); var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; print(url); launch(url); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 9224ae1f..7a58a4f1 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -47,7 +47,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; -import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; @@ -55,7 +54,7 @@ import 'package:provider/provider.dart'; class ToDo extends StatefulWidget { PatientShareResponse? patientShareResponse; var languageID; - MyInAppBrowser? browser; + // MyInAppBrowser? browser; bool? isShowAppBar = true; Function()? onBackClick; bool? isFromMyAppointments; @@ -1089,7 +1088,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { projectViewModel.analytics.todoList.to_do_list_pay_now(appo); } - openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { + openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); browser?.openPaymentBrowser( @@ -1103,8 +1102,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { authenticatedUser.firstName!, authenticatedUser.patientID, authenticatedUser, - widget!.browser!, - appo.isLiveCareAppointment!, + browser!, + appo.isLiveCareAppointment ?? false, "2", appo.isLiveCareAppointment! ? widget.patientShareResponse!.clinicID.toString() : "", context, @@ -1308,7 +1307,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context).then((res) { + service + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context) + .then((res) { GifLoaderDialogUtils.hideDialog(context); getPatientAppointmentHistory(); }).catchError((err) { diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart index 53c08e41..61e74acb 100644 --- a/lib/pages/medical/labs/passport_update_page.dart +++ b/lib/pages/medical/labs/passport_update_page.dart @@ -135,12 +135,12 @@ class _PassportUpdatePageState extends State { ), ), Container( + width: MediaQuery.of(context).size.width, margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0), child: ButtonTheme( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: MediaQuery.of(context).size.width, height: 45.0, child: CustomTextButton( backgroundColor: Color(0xFFc5272d), @@ -284,7 +284,7 @@ class _PassportUpdatePageState extends State { service.getCovidPassportNumber().then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['Covid19_Certificate_GetPassportList'].length != 0) { - passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; + passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] ?? ""; if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { _isButtonDisabled = false; } diff --git a/lib/pages/medical/medical_profile_page_new.dart b/lib/pages/medical/medical_profile_page_new.dart index a4f21c80..e28542cf 100644 --- a/lib/pages/medical/medical_profile_page_new.dart +++ b/lib/pages/medical/medical_profile_page_new.dart @@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_new_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -33,7 +32,7 @@ class _MedicalProfilePageState extends State { var appoCountProvider = Provider.of(context); List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel!.isLogin); return BaseView( - onModelReady: (model) => model.getAppointmentHistory(), + // onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget1) => AppScaffold( isShowDecPage: false, isShowAppBar: false, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index c9c43293..90a93a12 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -6,7 +5,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; @@ -95,9 +93,9 @@ class DoctorCard extends StatelessWidget { color: Utils.isHMCProject(projectViewModel, projectID) ? Color(0xff3FACC8) - : isLiveCareAppointment !=null && isLiveCareAppointment==true + : isLiveCareAppointment != null && isLiveCareAppointment == true ? Color(0xff2E303A) - : isInOutPatient !=null && isInOutPatient ==false + : isInOutPatient != null && isInOutPatient == false ? Color(0xffD02127) : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -112,9 +110,9 @@ class DoctorCard extends StatelessWidget { ? RotatedBox( quarterTurns: 3, child: Text( - isLiveCareAppointment !=null && isLiveCareAppointment==true + isLiveCareAppointment != null && isLiveCareAppointment == true ? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach - : isInOutPatient!=null && isInOutPatient ==false + : isInOutPatient != null && isInOutPatient == false ? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach : TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10), @@ -183,11 +181,11 @@ class DoctorCard extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - MyRichText(isSortByClinic! ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName ??"", projectViewModel!.isArabic), + MyRichText(isSortByClinic! ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName ?? "", projectViewModel!.isArabic), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel!.isArabic), + if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).orderNo, billNo ?? "", projectViewModel!.isArabic), if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel!.isArabic), if (rating != null) Row( @@ -216,7 +214,8 @@ class DoctorCard extends StatelessWidget { ), half: Icon( Icons.star_half, - color: CustomColors.accentColor, ), + color: CustomColors.accentColor, + ), empty: Icon( Icons.star_border, color: CustomColors.accentColor, diff --git a/lib/widgets/data_display/medical/time_line_new_widget.dart b/lib/widgets/data_display/medical/time_line_new_widget.dart index 3419a858..af2386bf 100644 --- a/lib/widgets/data_display/medical/time_line_new_widget.dart +++ b/lib/widgets/data_display/medical/time_line_new_widget.dart @@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; @@ -44,7 +43,7 @@ class _TimeLineViewState extends State { @override void initState() { super.initState(); - // selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString()); + // selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString()); dateObjs.add(DateObj(0, 0, widget.isArabic ? "الكل" : "All")); for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { tempList.add(widget.appoitmentAllHistoryResultList[i]); @@ -62,7 +61,7 @@ class _TimeLineViewState extends State { dateObjs = dateObjs.toSet().toList(); dateObjs.sort((a, b) => a.month.compareTo(b.month)); dateObjs.sort((a, b) => a.year.compareTo(b.year)); - logger.d(dateObjs); + // logger.d(dateObjs); for (int i = 0; i < dateObjs.length; i++) { print(dateObjs[i].monthYear.toString()); @@ -167,7 +166,6 @@ class _TimeLineViewState extends State { ), ), ) - : Container() ], ), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index fe68467e..9ffec736 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -14,9 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } @@ -40,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser { static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS @@ -60,7 +58,7 @@ class MyInAppBrowser extends InAppBrowser { static List errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled']; - final Function? onExitCallback; + final Function onExitCallback; final Function? onLoadStartCallback; final BuildContext? context; @@ -78,7 +76,7 @@ class MyInAppBrowser extends InAppBrowser { static bool isPaymentDone = false; - MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); + MyInAppBrowser({required this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); Future onBrowserCreated() async { print("\n\nBrowser Created!\n\n"); @@ -89,8 +87,6 @@ class MyInAppBrowser extends InAppBrowser { if (onLoadStartCallback != null) onLoadStartCallback!(url.toString()); } - - @override Future onLoadStop(Uri? url) async { print("\n\nStopped $url\n\n"); @@ -106,8 +102,15 @@ class MyInAppBrowser extends InAppBrowser { @override void onExit() { - print("\n\nBrowser closed!\n\n"); - if (onExitCallback != null) onExitCallback!(appo, isPaymentDone); + print("\n\nBrowser closed before!\n\n"); + // if (onExitCallback != null) { + try { + onExitCallback(appo, isPaymentDone); + print("\n\nBrowser closed after!\n\n"); + } catch (err) { + print(err.toString()); + } + // } } @override @@ -145,7 +148,8 @@ class MyInAppBrowser extends InAppBrowser { // await getPatientData(); if (paymentMethod == "ApplePay") { getDeviceToken(); - MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); + MyChromeSafariBrowser safariBrowser = + new MyChromeSafariBrowser(new MyInAppBrowser(onExitCallback: browser.onExit), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); if (context != null) GifLoaderDialogUtils.showMyDialog(context); @@ -249,7 +253,8 @@ class MyInAppBrowser extends InAppBrowser { openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, AuthenticatedUser authenticatedUser, InAppBrowser browser) { this.browser = browser; - MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); + MyChromeSafariBrowser safariBrowser = + new MyChromeSafariBrowser(new MyInAppBrowser(onExitCallback: browser.onExit), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); // getPatientData(); generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { if (order.customValuesXml!.contains("ApplePay")) { @@ -476,7 +481,7 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser { final Function? onLoadStartCallback; AppoitmentAllHistoryResultList? appo; - MyChromeSafariBrowser(browserFallback, { this.onExitCallback, this.onLoadStartCallback, this.appo}); + MyChromeSafariBrowser(browserFallback, {this.onExitCallback, this.onLoadStartCallback, this.appo}); @override void onOpened() {