From 7b181192f6c4168db1dc7ec96e56f7420c097bec Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 13 Mar 2024 22:55:29 +0300 Subject: [PATCH 1/3] Apple Pay updates --- .../ancillaryOrdersDetails.dart | 47 +++++++++-------- lib/pages/BookAppointment/BookSuccess.dart | 47 +++++++++-------- lib/pages/ToDoList/ToDo.dart | 47 +++++++++-------- lib/pages/livecare/widgets/clinic_list.dart | 51 ++++++++++--------- .../medical/balance/confirm_payment_page.dart | 47 +++++++++-------- 5 files changed, 132 insertions(+), 107 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 250ccc64..38e4b3f5 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -587,27 +587,32 @@ class _AnicllaryOrdersState extends State with SingleTic applePayInsertRequest.returnURL = ""; service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { - await context.read().initiateApplePayWithPayfort( - customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, - // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", - orderDescription: "Ancillary Order Payment", - orderAmount: double.parse(getTotalValue()), - merchantReference: transID, - payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", - onFailed: (failureResult) async { - log("failureResult: ${failureResult.toString()}"); - AppToast.showErrorToast(message: failureResult.toString()); - }, - onSuccess: (successResult) async { - log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult); - checkPaymentStatus(AppoitmentAllHistoryResultList()); - }, - projectId: widget.projectID, - serviceTypeEnum: ServiceTypeEnum.ancillaryOrder, - ); + if (res["MessageStatus"] == 1) { + await context.read().initiateApplePayWithPayfort( + customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", + orderDescription: "Ancillary Order Payment", + orderAmount: double.parse(getTotalValue()), + merchantReference: transID, + payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", + onFailed: (failureResult) async { + log("failureResult: ${failureResult.toString()}"); + AppToast.showErrorToast(message: failureResult.toString()); + }, + onSuccess: (successResult) async { + log("Payfort: ${successResult.responseMessage}"); + await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult); + checkPaymentStatus(AppoitmentAllHistoryResultList()); + }, + projectId: widget.projectID, + serviceTypeEnum: ServiceTypeEnum.ancillaryOrder, + ); + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: "An error occurred while processing your request"); + } }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 068d0ec6..c67433a1 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -701,27 +701,32 @@ class _BookSuccessState extends State { applePayInsertRequest.returnURL = ""; service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { - await context.read().initiateApplePayWithPayfort( - customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, - // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", - orderDescription: "Appointment Payment", - orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()), - merchantReference: transID, - payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", - onFailed: (failureResult) async { - log("failureResult: ${failureResult.toString()}"); - AppToast.showErrorToast(message: failureResult.toString()); - }, - onSuccess: (successResult) async { - log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult); - checkPaymentStatus(appo); - }, - projectId: appo.projectID, - serviceTypeEnum: ServiceTypeEnum.appointmentPayment, - ); + if (res["MessageStatus"] == 1) { + await context.read().initiateApplePayWithPayfort( + customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", + orderDescription: "Appointment Payment", + orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()), + merchantReference: transID, + payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", + onFailed: (failureResult) async { + log("failureResult: ${failureResult.toString()}"); + AppToast.showErrorToast(message: failureResult.toString()); + }, + onSuccess: (successResult) async { + log("Payfort: ${successResult.responseMessage}"); + await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult); + checkPaymentStatus(appo); + }, + projectId: appo.projectID, + serviceTypeEnum: ServiceTypeEnum.appointmentPayment, + ); + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: "An error occurred while processing your request"); + } }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 1c4c111b..5d21d5fc 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1405,27 +1405,32 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { applePayInsertRequest.returnURL = ""; service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { - await context.read().initiateApplePayWithPayfort( - customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, - // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", - orderDescription: "Appointment Payment", - orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()), - merchantReference: transID, - payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", - onFailed: (failureResult) async { - log("failureResult: ${failureResult.toString()}"); - AppToast.showErrorToast(message: failureResult.toString()); - }, - onSuccess: (successResult) async { - log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult); - checkPaymentStatus(appo); - }, - projectId: appo.projectID, - serviceTypeEnum: ServiceTypeEnum.appointmentPayment, - ); + if (res["MessageStatus"] == 1) { + await context.read().initiateApplePayWithPayfort( + customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", + orderDescription: "Appointment Payment", + orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()), + merchantReference: transID, + payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", + onFailed: (failureResult) async { + log("failureResult: ${failureResult.toString()}"); + AppToast.showErrorToast(message: failureResult.toString()); + }, + onSuccess: (successResult) async { + log("Payfort: ${successResult.responseMessage}"); + await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult); + checkPaymentStatus(appo); + }, + projectId: appo.projectID, + serviceTypeEnum: ServiceTypeEnum.appointmentPayment, + ); + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: "An error occurred while processing your request"); + } }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 917b7488..d57adc1a 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -409,29 +409,34 @@ class _clinic_listState extends State { applePayInsertRequest.returnURL = ""; service.applePayInsertRequest(applePayInsertRequest, localContext).then((res) async { - await localContext.read().initiateApplePayWithPayfort( - customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, - // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", - orderDescription: "LiveCare Payment", - orderAmount: double.parse(amount), - merchantReference: transID, - payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", - onFailed: (failureResult) async { - log("failureResult: ${failureResult.toString()}"); - GifLoaderDialogUtils.hideDialog(localContext); - AppToast.showErrorToast(message: failureResult.toString()); - }, - onSuccess: (successResult) async { - GifLoaderDialogUtils.hideDialog(localContext); - log("Payfort: ${successResult.responseMessage}"); - await localContext.read().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult); - checkPaymentStatus(appo); - }, - projectId: appo.projectID, - serviceTypeEnum: ServiceTypeEnum.appointmentPayment, - ); + if (res["MessageStatus"] == 1) { + await localContext.read().initiateApplePayWithPayfort( + customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", + orderDescription: "LiveCare Payment", + orderAmount: double.parse(amount), + merchantReference: transID, + payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", + onFailed: (failureResult) async { + log("failureResult: ${failureResult.toString()}"); + GifLoaderDialogUtils.hideDialog(localContext); + AppToast.showErrorToast(message: failureResult.toString()); + }, + onSuccess: (successResult) async { + GifLoaderDialogUtils.hideDialog(localContext); + log("Payfort: ${successResult.responseMessage}"); + await localContext.read().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult); + checkPaymentStatus(appo); + }, + projectId: appo.projectID, + serviceTypeEnum: ServiceTypeEnum.appointmentPayment, + ); + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: "An error occurred while processing your request"); + } }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(localContext); diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index aeaa4e75..d7ab3efb 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -310,27 +310,32 @@ class _ConfirmPaymentPageState extends State { applePayInsertRequest.returnURL = ""; service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { - await context.read().initiateApplePayWithPayfort( - customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${widget.advanceModel.fileNumber}@HMG.com", - orderDescription: "Advance Payment", - orderAmount: double.parse(widget.advanceModel.amount), - merchantReference: transID, - payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", - onFailed: (failureResult) async { - log("failureResult: ${failureResult.toString()}"); - AppToast.showErrorToast(message: failureResult.toString()); - }, - onSuccess: (successResult) async { - log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(num.parse(widget.advanceModel.fileNumber), result: successResult); - checkPaymentStatus(AppoitmentAllHistoryResultList()); - }, - projectId: widget.advanceModel.hospitalsModel.iD, - serviceTypeEnum: ServiceTypeEnum.advancePayment, - ); + if (res["MessageStatus"] == 1) { + await context.read().initiateApplePayWithPayfort( + customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${widget.advanceModel.fileNumber}@HMG.com", + orderDescription: "Advance Payment", + orderAmount: double.parse(widget.advanceModel.amount), + merchantReference: transID, + payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, + currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", + onFailed: (failureResult) async { + log("failureResult: ${failureResult.toString()}"); + AppToast.showErrorToast(message: failureResult.toString()); + }, + onSuccess: (successResult) async { + log("Payfort: ${successResult.responseMessage}"); + await context.read().addPayfortApplePayResponse(num.parse(widget.advanceModel.fileNumber), result: successResult); + checkPaymentStatus(AppoitmentAllHistoryResultList()); + }, + projectId: widget.advanceModel.hospitalsModel.iD, + serviceTypeEnum: ServiceTypeEnum.advancePayment, + ); + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: "An error occurred while processing your request"); + } }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); From f8e7ccf73f20c28e1855ca00ea874f91b0e12a34 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Mar 2024 10:40:51 +0300 Subject: [PATCH 2/3] updates --- lib/config/localized_values.dart | 78 ++- lib/core/service/client/base_app_client.dart | 90 +-- lib/pages/Blood/blood_donation.dart | 78 +-- .../widgets/AppointmentActions.dart | 60 +- lib/pages/ToDoList/ToDo.dart | 608 +++++++++--------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- lib/widgets/new_design/doctor_header.dart | 60 +- 7 files changed, 501 insertions(+), 477 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f05b94f3..1f5120bb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -182,7 +182,10 @@ const Map localizedValues = { 'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'}, 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, - 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC or QR Code to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وقم بالمسح الضوئي عبر NFC أو رمز الاستجابة السريعة لتسجيل الوصول'}, + 'scanQRHospital': { + 'en': 'Approach the Online Check-In board in the hospital & scan via NFC or QR Code to Check-In', + 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وقم بالمسح الضوئي عبر NFC أو رمز الاستجابة السريعة لتسجيل الوصول' + }, 'scanNFC': {'en': 'Scan NFC to Check-In', 'ar': 'مسح NFC لتسجيل الوصول'}, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, "success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"}, @@ -1845,39 +1848,51 @@ const Map localizedValues = { "privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"}, "termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"}, "prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."}, - "liveCarePermissions": {"en": "LiveCare requires Camera, Microphone & Location permissions to enable virtual consultation between patient & doctor, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون والموقع، يرجى السماح لها بالمتابعة."}, - "lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" }, - "lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" }, - "lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" }, - "deleteAccount": { "en": "Deactivate Account", "ar": "ايقاف الحساب مؤقتاً" }, - "deactivateAccount": { "en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد ايقاف الحساب مؤقتاً حسابك؟" }, - "accountDeactivated": { "en": "Your account has been deactivated successfully", "ar": "تم ايقاف الحساب مؤقتاً بنجاح." }, - "accountDeactivatedMsg": { "en": "Your account has been deactivated. Would you like to reactivate it?", "ar": "حسابك معطل. هل ترغب في إعادة تنشيطه مرة أخرى؟" }, - "updateInsuranceManually": { "en": "Update Insurance Manually", "ar": "تحديث التأمين يدويا" }, - "or": { "en": "Update Insurance Manually", "ar": "تحديث التأمين يدويا" }, - "enterInsuranceDetails": { "en": "Please enter your insurance card details below:", "ar": "الرجاء إدخال تفاصيل بطاقة التأمين الخاصة بك أدناه:" }, - "cardHolderName": { "en": "Card Holder Name", "ar": "إسم صاحب البطاقة" }, - "membershipNo": { "en": "Membership No.", "ar": "رقم العضوية" }, - "policyNo": { "en": "Policy No.", "ar": "رقم وثيقة التأمين" }, - "paymentOnly": { "en": "Payment", "ar": "معلقة" }, - "pendingOnly": { "en": "Pending", "ar": "مدفوعات" }, - "insuranceClassName": { "en": "Insurance Class", "ar": "فئة التأمين" }, - "insuranceRequestSubmit": { "en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح." }, - "NFCNotSupported": { "en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" }, + "liveCarePermissions": { + "en": "LiveCare requires Camera, Microphone & Location permissions to enable virtual consultation between patient & doctor, Please allow these to proceed.", + "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون والموقع، يرجى السماح لها بالمتابعة." + }, + "lakumUnhold": {"en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل"}, + "lakumDiscontinue": {"en": "The account is closed", "ar": "الحساب مغلق"}, + "lakumSuccess": {"en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح"}, + "deleteAccount": {"en": "Deactivate Account", "ar": "ايقاف الحساب مؤقتاً"}, + "deactivateAccount": {"en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد ايقاف الحساب مؤقتاً حسابك؟"}, + "accountDeactivated": {"en": "Your account has been deactivated successfully", "ar": "تم ايقاف الحساب مؤقتاً بنجاح."}, + "accountDeactivatedMsg": {"en": "Your account has been deactivated. Would you like to reactivate it?", "ar": "حسابك معطل. هل ترغب في إعادة تنشيطه مرة أخرى؟"}, + "updateInsuranceManually": {"en": "Update Insurance Manually", "ar": "تحديث التأمين يدويا"}, + "or": {"en": "Update Insurance Manually", "ar": "تحديث التأمين يدويا"}, + "enterInsuranceDetails": {"en": "Please enter your insurance card details below:", "ar": "الرجاء إدخال تفاصيل بطاقة التأمين الخاصة بك أدناه:"}, + "cardHolderName": {"en": "Card Holder Name", "ar": "إسم صاحب البطاقة"}, + "membershipNo": {"en": "Membership No.", "ar": "رقم العضوية"}, + "policyNo": {"en": "Policy No.", "ar": "رقم وثيقة التأمين"}, + "paymentOnly": {"en": "Payment", "ar": "معلقة"}, + "pendingOnly": {"en": "Pending", "ar": "مدفوعات"}, + "insuranceClassName": {"en": "Insurance Class", "ar": "فئة التأمين"}, + "insuranceRequestSubmit": {"en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح."}, + "NFCNotSupported": {"en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول"}, "enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"}, "workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"}, "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"}, - "needApproval": {"en": "Your sick leave is under process in medical administration, you will be notified once approved.", "ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها."}, + "needApproval": { + "en": "Your sick leave is under process in medical administration, you will be notified once approved.", + "ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها." + }, "pendingActivation": {"en": "Pending Activation", "ar": "في انتظار التنشيط"}, "awaitingApproval": {"en": "Awaiting Approval", "ar": "انتظر القبول"}, "liveCareSupportContact": {"en": "LiveCare Support Contact: ", "ar": "اتصل لايف كير: "}, "pharmaLiveCare": {"en": "Pharma LiveCare", "ar": "لايف كير الصيدلية"}, "pharmaLiveCare1": {"en": "What is Pharma LiveCare?", "ar": "ما هولايف كير الصيدلية؟"}, - "pharmaLiveCareDesc1": {"en": "Pharma LiveCare allows you to get consultation from your doctor virtually being in HMG Pharmacy booth.", "ar": "تتيح لك خدمة لايف كير الصيدلية الحصول على استشارة من طبيبك المتواجد فعليًا في كشك صيدلية د.سليمان الحبيب."}, + "pharmaLiveCareDesc1": { + "en": "Pharma LiveCare allows you to get consultation from your doctor virtually being in HMG Pharmacy booth.", + "ar": "تتيح لك خدمة لايف كير الصيدلية الحصول على استشارة من طبيبك المتواجد فعليًا في كشك صيدلية د.سليمان الحبيب." + }, "wherePharmaLiveCare": {"en": "Where can i find Pharma LiveCare?", "ar": "أين يمكنني أن أجد لايف كير الصيدلية؟"}, "pharmaLiveCareDesc2": {"en": "You can find the booth in HMG Pharmacies.", "ar": "يمكنك العثور على الكشك في صيدليات مستشفى د.سليمان الحبيب."}, "howPharmaLiveCare": {"en": "How can i use Pharma LiveCare?", "ar": "كيف يمكنني استخدام لايف كير الصيدلية؟"}, - "pharmaLiveCareDesc3": {"en": "Following the below steps you can easily benefit from the virtual consultation service:", "ar": "باتباع الخطوات التالية يمكنك الاستفادة بسهولة من خدمة الاستشارة الافتراضية:"}, + "pharmaLiveCareDesc3": { + "en": "Following the below steps you can easily benefit from the virtual consultation service:", + "ar": "باتباع الخطوات التالية يمكنك الاستفادة بسهولة من خدمة الاستشارة الافتراضية:" + }, "pharmaLiveCareScanQR": {"en": "Scan QR Code", "ar": "مسح رمز الاستجابة السريعة"}, "pharmaLiveCareScanQR1": {"en": "Scan the QR Code in the booth to make the connection", "ar": "امسح رمز الاستجابة السريعة في المقصورة لإجراء الاتصال"}, "pharmaLiveCareMakePayment": {"en": "Make Payment Online", "ar": "قم بالدفع عبر الإنترنت"}, @@ -1893,19 +1908,28 @@ const Map localizedValues = { "sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."}, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, "selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"}, - "invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."}, + "invalidEligibility": { + "en": "You cannot make online payment because you are not eligible to use the provided service.", + "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة." + }, "invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."}, "continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"}, "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, - "cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"}, + "cashAmountUpdateInsurance": { + "en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", + "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:" + }, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, "contactRRT": {"en": "Contact RRT", "ar": "تواصل مع فريق الاستجابة السريعة"}, "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, - "locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."}, + "locationCheckInError": { + "en": "Please make sure that you're within the hospital location to perform online check-in.", + "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت." + }, "upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"}, "noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"}, "locationTimeoutError": {"en": "Unable to fetch your location, Please try again.", "ar": "غير قادر على جلب موقعك، يرجى المحاولة مرة أخرى."}, "loadMore": {"en": "Load More", "ar": "تحميل المزيد"}, -}; \ No newline at end of file +}; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index d0d5ed1b..10d18e3a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -38,12 +38,12 @@ class BaseAppClient { post(String endPoint, {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - bool isAllowAny = false, - bool isExternal = false, - bool isRCService = false, - bool bypassConnectionCheck = false}) async { + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + bool isAllowAny = false, + bool isExternal = false, + bool isRCService = false, + bool bypassConnectionCheck = false}) async { String url; if (isExternal) { url = endPoint; @@ -66,8 +66,8 @@ class BaseAppClient { if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null - ? body['SetupID'] - : SETUP_ID + ? body['SetupID'] + : SETUP_ID : SETUP_ID; } @@ -80,8 +80,8 @@ class BaseAppClient { body['LanguageID'] = body['LanguageID'] == 'ar' ? 1 : body['LanguageID'] == 'en' - ? 2 - : body['LanguageID']; + ? 2 + : body['LanguageID']; } else { body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; } @@ -105,16 +105,16 @@ class BaseAppClient { if (body.containsKey('isDentalAllowedBackend')) { body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isIOS ? 1 : await Utils.isGoogleServicesAvailable() - ? 2 - : 3; + ? 2 + : 3; if (!body.containsKey('IsPublicRequest')) { // if (!body.containsKey('PatientType')) { @@ -155,8 +155,8 @@ class BaseAppClient { body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null - ? body['PatientOutSA'] - : user['OutSA'] + ? body['PatientOutSA'] + : user['OutSA'] : user['OutSA']; body['SessionID'] = getSessionId(body['TokenID'] != null ? body['TokenID'] : ""); //getSe // body['SessionID'] = body['TokenID']; //getSe @@ -458,16 +458,16 @@ class BaseAppClient { Navigator.pushAndRemoveUntil( context, MaterialPageRoute(builder: (context) => AppUpdatePage(appUpdateText: text)), - (Route route) => false, + (Route route) => false, ); } get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - Map queryParams, - bool isExternal = false, - bool isRCService = false}) async { + Function(String error, int statusCode) onFailure, + Map queryParams, + bool isExternal = false, + bool isRCService = false}) async { String url; if (isExternal) { url = endPoint; @@ -508,10 +508,10 @@ class BaseAppClient { getPharmacy(String endPoint, {Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - bool isAllowAny = false, - bool isExternal = false, - Map queryParams}) async { + Function(String error, int statusCode) onFailure, + bool isAllowAny = false, + bool isExternal = false, + Map queryParams}) async { var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var user = await sharedPref.getObject(USER_PROFILE); @@ -565,12 +565,12 @@ class BaseAppClient { } simplePost( - String fullUrl, { - Map body, - Map headers, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - }) async { + String fullUrl, { + Map body, + Map headers, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + }) async { String url = fullUrl; // print("URL Query String: $url"); // print("body: $body"); @@ -764,8 +764,8 @@ class BaseAppClient { if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null - ? body['SetupID'] - : SETUP_ID + ? body['SetupID'] + : SETUP_ID : SETUP_ID; } @@ -777,15 +777,15 @@ class BaseAppClient { body['generalid'] = GENERAL_ID; body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null - ? body['PatientOutSA'] - : user['OutSA'] + ? body['PatientOutSA'] + : user['OutSA'] : user['OutSA']; if (body.containsKey('isDentalAllowedBackend')) { body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND; } @@ -794,18 +794,18 @@ class BaseAppClient { if (!body.containsKey('IsPublicRequest')) { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null - ? body['PatientType'] - : user['PatientType'] != null - ? user['PatientType'] - : user['PatientType'] + ? body['PatientType'] + : user['PatientType'] != null + ? user['PatientType'] + : user['PatientType'] : user['PatientType']; body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : user['PatientType'] != null - ? user['PatientType'] - : user['PatientType'] + ? body['PatientTypeID'] + : user['PatientType'] != null + ? user['PatientType'] + : user['PatientType'] : user['PatientType']; if (user != null) { body['TokenID'] = token; diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 717be242..5e4de7ee 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -136,31 +136,31 @@ class _BloodDonationPageState extends State { if (projectProvider.isLogin && model.state != ViewState.Busy) CommonDropDownView( - TranslationBase.of(context).city, - model.CitiesModelList.isNotEmpty - ? projectProvider.isArabic - ? model.CitiesModelList[_selectedHospitalIndex].descriptionN - : model.CitiesModelList[_selectedHospitalIndex].description - : "", () { - List list = [ - for (int i = 0; i < model.CitiesModelList.length; i++) - RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), - ]; + TranslationBase.of(context).city, + model.CitiesModelList.isNotEmpty + ? projectProvider.isArabic + ? model.CitiesModelList[_selectedHospitalIndex].descriptionN + : model.CitiesModelList[_selectedHospitalIndex].description + : "", () { + List list = [ + for (int i = 0; i < model.CitiesModelList.length; i++) + RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), + ]; - showDialog( - context: context, - builder: (cxt) => RadioSelectionDialog( - listData: list, - selectedIndex: _selectedHospitalIndex, - isScrollable: true, - onValueSelected: (index) { - _selectedHospitalIndex = index; - _selectedHospital = model.CitiesModelList[index]; - setState(() {}); - }, - ), - ); - }).withBorderedContainer, + showDialog( + context: context, + builder: (cxt) => RadioSelectionDialog( + listData: list, + selectedIndex: _selectedHospitalIndex, + isScrollable: true, + onValueSelected: (index) { + _selectedHospitalIndex = index; + _selectedHospital = model.CitiesModelList[index]; + setState(() {}); + }, + ), + ); + }).withBorderedContainer, SizedBox(height: 12), CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () { List list = [ @@ -276,21 +276,21 @@ class _BloodDonationPageState extends State { TranslationBase.of(context).save, checkedValue ? () async { - if (_selectedHospital == null) { - AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); - return; - } - bloodDetails.city = _selectedHospital.description; - bloodDetails.cityCode = _selectedHospital.iD.toString(); - bloodDetails.gender = _selectedGenderIndex; - bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex); - await model.updateBloodGroup(bloodDetails); - if (model.state == ViewState.Idle) { - AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); - } else { - AppToast.showErrorToast(message: model.error); - } - } + if (_selectedHospital == null) { + AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); + return; + } + bloodDetails.city = _selectedHospital.description; + bloodDetails.cityCode = _selectedHospital.iD.toString(); + bloodDetails.gender = _selectedGenderIndex; + bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex); + await model.updateBloodGroup(bloodDetails); + if (model.state == ViewState.Idle) { + AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); + } else { + AppToast.showErrorToast(message: model.error); + } + } : null, disabledColor: CustomColors.grey2, ).insideContainer diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 86a80be2..0135ac19 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -83,8 +83,8 @@ class _AppointmentActionsState extends State { onTap: shouldEnable ? null : () { - _handleButtonClicks(appoButtonsList[index], model); - }, + _handleButtonClicks(appoButtonsList[index], model); + }, child: MedicalProfileItem( title: appoButtonsList[index].title, imagePath: appoButtonsList[index].icon, @@ -133,7 +133,7 @@ class _AppointmentActionsState extends State { locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'add reminder'); break; case "goToTodoList": - // Navigator.of(context).pop(); + // Navigator.of(context).pop(); navigateToToDoPage(context, model); locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'todo list'); break; @@ -506,22 +506,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) {}) + 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) {}) .then((value) { print("Dialog Closed"); print(value); @@ -576,10 +576,10 @@ class _AppointmentActionsState extends State { context, FadePage( page: VitalSignDetailsScreen( - appointmentNo: appoNo, - projectID: projectID, - isNotOneAppointment: false, - ))); + appointmentNo: appoNo, + projectID: projectID, + isNotOneAppointment: false, + ))); } navigateToInsertComplaint() { @@ -587,9 +587,9 @@ class _AppointmentActionsState extends State { context, FadePage( page: FeedbackHomePage( - messageType: MessageType.ComplaintOnAnAppointment, - appointment: widget.appo, - ))); + messageType: MessageType.ComplaintOnAnAppointment, + appointment: widget.appo, + ))); } navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { @@ -604,10 +604,10 @@ class _AppointmentActionsState extends State { context, FadePage( page: ToDo( - isShowAppBar: true, - isFromMyAppointments: true, - appointment: widget.appo, - ))); + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 5d21d5fc..c8c767b1 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -176,189 +176,189 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { title: TranslationBase.of(context).appointments, bodyWidget: appoList.length != 0 ? ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: appoList.length, - itemBuilder: (context, index) { - return Container( - width: double.infinity, - margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0), - decoration: cardRadius(12), - padding: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: appoList.length, + itemBuilder: (context, index) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0), + decoration: cardRadius(12), + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(top: 4.0), - child: appoList[index].clinicID == 265 - ? Container( - margin: EdgeInsets.only(left: 5.0, right: 5.0), - child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), - ) - : appoList[index].isLiveCareAppointment - ? SvgPicture.asset("assets/images/new/virtual.svg") - : SvgPicture.asset("assets/images/new/hospital-visit.svg"), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Text( - appoList[index].clinicID == 265 - ? TranslationBase.of(context).covidTestTodo - : appoList[index].isLiveCareAppointment - ? TranslationBase.of(context).liveCareAppo - : TranslationBase.of(context).walkinAppo, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), - ), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: CountdownTimer( - controller: - new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay * 1000) * 60), - widgetBuilder: (_, CurrentRemainingTime time) { - return time != null - ? Text( - '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' + - TranslationBase.of(context).upcomingTimeLeft, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48)) - : Container(); - }, - ), - ), - ], - ), - ], - ), + Padding( + padding: const EdgeInsets.only(top: 4.0), + child: appoList[index].clinicID == 265 + ? Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), + ) + : appoList[index].isLiveCareAppointment + ? SvgPicture.asset("assets/images/new/virtual.svg") + : SvgPicture.asset("assets/images/new/hospital-visit.svg"), ), - Expanded( - child: Container( - child: InkWell( - onTap: () { - performNextAction(appoList[index]); - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), - decoration: BoxDecoration( - color: getNextActionButtonColor(appoList[index].nextAction), - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.circular(6), - ), - child: Text( - getNextActionText(appoList[index].nextAction), - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), - ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text( + appoList[index].clinicID == 265 + ? TranslationBase.of(context).covidTestTodo + : appoList[index].isLiveCareAppointment + ? TranslationBase.of(context).liveCareAppo + : TranslationBase.of(context).walkinAppo, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: CountdownTimer( + controller: + new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay * 1000) * 60), + widgetBuilder: (_, CurrentRemainingTime time) { + return time != null + ? Text( + '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' + + TranslationBase.of(context).upcomingTimeLeft, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48)) + : Container(); + }, ), ), - ), + ], ), ], ), - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: Text( - appoList[index].doctorTitle + " " + appoList[index].doctorNameObj, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Expanded( + child: Container( + child: InkWell( + onTap: () { + performNextAction(appoList[index]); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), + decoration: BoxDecoration( + color: getNextActionButtonColor(appoList[index].nextAction), + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.circular(6), + ), + child: Text( + getNextActionText(appoList[index].nextAction), + textAlign: TextAlign.center, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), + ), + ), ), ), - Row( + ), + ], + ), + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Text( + appoList[index].doctorTitle + " " + appoList[index].doctorNameObj, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + ), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + LargeAvatar( + name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj, + url: appoList[index].doctorImageURL, + width: 52, + height: 52, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - LargeAvatar( - name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj, - url: appoList[index].doctorImageURL, - width: 52, - height: 52, - ), - SizedBox(width: 11), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName, projectViewModel.isArabic), - // MyRichText(TranslationBase.of(context).appointmentDate + ": ", - // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), - - // Timezone changes - appoList[index].isLiveCareAppointment - ? MyRichText( - TranslationBase.of(context).appointmentDate + ": ", - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + - " " + - DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), - projectViewModel.isArabic) - : MyRichText( - TranslationBase.of(context).appointmentDate + ": ", - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + - " " + - appoList[index].startTime.substring(0, 5), - projectViewModel.isArabic), - - MyRichText(TranslationBase.of(context).branch, appoList[index].projectName, projectViewModel.isArabic), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: appoList[index].actualDoctorRate.toDouble(), - size: 16.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, - ), - ], - ), - ], - ), + MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName, projectViewModel.isArabic), + // MyRichText(TranslationBase.of(context).appointmentDate + ": ", + // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), + + // Timezone changes + appoList[index].isLiveCareAppointment + ? MyRichText( + TranslationBase.of(context).appointmentDate + ": ", + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + + " " + + DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), + projectViewModel.isArabic) + : MyRichText( + TranslationBase.of(context).appointmentDate + ": ", + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + + " " + + appoList[index].startTime.substring(0, 5), + projectViewModel.isArabic), + + MyRichText(TranslationBase.of(context).branch, appoList[index].projectName, projectViewModel.isArabic), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: appoList[index].actualDoctorRate.toDouble(), + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + ], ), ], ), - Padding( - padding: const EdgeInsets.only(top: 12.0), - child: Text( - getNextActionDescription(appoList[index].nextAction), - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16), - ), - ), - InkWell( - onTap: () { - navigateToAppointmentDetails(context, appoList[index]); - }, - child: Padding( - padding: const EdgeInsets.only(top: 0.0), - child: Text( - TranslationBase.of(context).moreDetails, - style: TextStyle( - fontSize: 10, - fontWeight: FontWeight.w600, - color: CustomColors.accentColor, - letterSpacing: -0.48, - height: 25 / 16, - decoration: TextDecoration.underline), - ), - ), - ), - ], + ), + ], + ), + Padding( + padding: const EdgeInsets.only(top: 12.0), + child: Text( + getNextActionDescription(appoList[index].nextAction), + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16), + ), + ), + InkWell( + onTap: () { + navigateToAppointmentDetails(context, appoList[index]); + }, + child: Padding( + padding: const EdgeInsets.only(top: 0.0), + child: Text( + TranslationBase.of(context).moreDetails, + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + color: CustomColors.accentColor, + letterSpacing: -0.48, + height: 25 / 16, + decoration: TextDecoration.underline), + ), ), - ); - }, - ) + ), + ], + ), + ); + }, + ) : getNoDataWidget(context), ), ), @@ -371,28 +371,28 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { title: TranslationBase.of(context).anicllaryOrders, bodyWidget: ancillaryLists.length != 0 ? Container( - padding: EdgeInsets.all(12), - child: ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - reverse: true, - itemBuilder: (context, index) { - return DoctorCard( - onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList[index], ancillaryLists[0].projectID), - isInOutPatient: true, - name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), - billNo: ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), - profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", - subName: ancillaryLists[0].projectName, - isLiveCareAppointment: false, - date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList[index].orderDate), - isSortByClinic: true, - ); - }, - itemCount: ancillaryLists[0].ancillaryOrderList.length, - separatorBuilder: (context, index) => SizedBox(height: 14), - ), - ) + padding: EdgeInsets.all(12), + child: ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + reverse: true, + itemBuilder: (context, index) { + return DoctorCard( + onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList[index], ancillaryLists[0].projectID), + isInOutPatient: true, + name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), + billNo: ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), + profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", + subName: ancillaryLists[0].projectName, + isLiveCareAppointment: false, + date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList[index].orderDate), + isSortByClinic: true, + ); + }, + itemCount: ancillaryLists[0].ancillaryOrderList.length, + separatorBuilder: (context, index) => SizedBox(height: 14), + ), + ) : getNoDataWidget(context), )), ], @@ -401,104 +401,104 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Container( child: obGyneAppoList.length != 0 ? ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: obGyneAppoList.length, - itemBuilder: (context, index) { - return Container( - width: double.infinity, - margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0), - decoration: cardRadius(12), - padding: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(top: 0.0), - child: Container( - margin: EdgeInsets.only(left: 5.0, right: 5.0), - child: SvgPicture.asset("assets/images/new/ultrasound.svg", width: 20.0, height: 20.0), - ), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Text(TranslationBase.of(context).walkinAppo, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), - ), - ], - ), - ], + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: obGyneAppoList.length, + itemBuilder: (context, index) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0), + decoration: cardRadius(12), + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(top: 0.0), + child: Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: SvgPicture.asset("assets/images/new/ultrasound.svg", width: 20.0, height: 20.0), ), - Container( - child: InkWell( - onTap: () { - getOBGyneDoctorsList(obGyneAppoList[index].projectID, obGyneAppoList[index].setupID, obGyneAppoList[index]); - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), - decoration: BoxDecoration( - color: CustomColors.green, - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.circular(6), - ), - child: Text( - TranslationBase.of(context).bookNow, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), - ), - ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text(TranslationBase.of(context).walkinAppo, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), ), + ], + ), + ], + ), + Container( + child: InkWell( + onTap: () { + getOBGyneDoctorsList(obGyneAppoList[index].projectID, obGyneAppoList[index].setupID, obGyneAppoList[index]); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), + decoration: BoxDecoration( + color: CustomColors.green, + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.circular(6), + ), + child: Text( + TranslationBase.of(context).bookNow, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), ), - ], - ), - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: Text( - TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), - Row( + ), + ], + ), + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Text( + TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + ), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + LargeAvatar( + name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName, + url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", + width: 52, + height: 52, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - LargeAvatar( - name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName, - url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", - width: 52, - height: 52, - ), - SizedBox(width: 11), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription, projectViewModel.isArabic), - MyRichText( - TranslationBase.of(context).orderDate + ": ", - DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0], - projectViewModel.isArabic), - MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription, projectViewModel.isArabic), - ], - ), - ), + MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription, projectViewModel.isArabic), + MyRichText( + TranslationBase.of(context).orderDate + ": ", + DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0], + projectViewModel.isArabic), + MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription, projectViewModel.isArabic), ], ), - ], - ), - ); - }, - ) + ), + ], + ), + ], + ), + ); + }, + ) : getNoDataWidget(context), ), ], @@ -557,7 +557,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { performNextAction(AppoitmentAllHistoryResultList appo) { switch (appo.nextAction) { case 0: - // getAppoQR(context, appo); + // getAppoQR(context, appo); break; case 10: confirmAppointment(appo); @@ -1063,22 +1063,22 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) { 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: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, isCashPatient: isCash), - ), - ); - }, - transitionDuration: Duration(milliseconds: 500), - barrierDismissible: false, - barrierLabel: '', - context: context, - pageBuilder: (context, animation1, animation2) {}) + 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: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, isCashPatient: isCash), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: false, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}) .then((value) { if (value != null) { navigateToPaymentMethod(context, value, appo); @@ -1321,13 +1321,13 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { 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) { print(value); selectedPaymentMethod = value[0]; @@ -1465,7 +1465,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); 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) + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index c9fecbf9..1ed0f663 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -224,7 +224,7 @@ class MyInAppBrowser extends InAppBrowser { service.tamaraInsertRequest(tamaraRequestModel, context).then((res) { if (context != null) GifLoaderDialogUtils.hideDialog(context); generateTamaraURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, - appoNo, clinicID, doctorID, "", installments) + appoNo, clinicID, doctorID, "", installments) .then((value) { paymentType = _PAYMENT_TYPE.PATIENT; this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions); @@ -236,7 +236,7 @@ class MyInAppBrowser extends InAppBrowser { }); } else { generateURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo, - clinicID, doctorID) + clinicID, doctorID) .then((value) { paymentType = _PAYMENT_TYPE.PATIENT; this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions); diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 7e75b63a..d302ea2d 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -26,14 +26,14 @@ class DoctorHeader extends StatelessWidget { DoctorHeader( {Key key, - @required this.headerModel, - @required this.buttonTitle, - @required this.onTap, - this.isNeedToShowButton = true, - this.isShowName = false, - this.buttonIcon, - this.showConfirmMessageDialog = true, - @required this.onRatingAndReviewTap}) + @required this.headerModel, + @required this.buttonTitle, + @required this.onTap, + this.isNeedToShowButton = true, + this.isShowName = false, + this.buttonIcon, + this.showConfirmMessageDialog = true, + @required this.onRatingAndReviewTap}) : super(key: key); ProjectViewModel projectViewModel; @@ -154,29 +154,29 @@ class DoctorHeader extends StatelessWidget { ), isNeedToShowButton ? InkWell( - onTap: () { - if (showConfirmMessageDialog) - showConfirmMessage(context, onTap, headerModel.email); - else - onTap(); - }, - child: Container( - padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), - decoration: BoxDecoration( - color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0), - SizedBox(width: 6), - Text( - buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 1), - ), - ], - ), + onTap: () { + if (showConfirmMessageDialog) + showConfirmMessage(context, onTap, headerModel.email); + else + onTap(); + }, + child: Container( + padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), + decoration: BoxDecoration( + color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0), + SizedBox(width: 6), + Text( + buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 1), ), - ) + ], + ), + ), + ) : Container(), ], ), From 69e64fd5fb1ca33fa1ec5778179ebae9e67ae4c7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Mar 2024 11:27:14 +0300 Subject: [PATCH 3/3] Blood Donation CR merged into dev_3.3 --- lib/config/config.dart | 16 +- lib/config/localized_values.dart | 1 + .../blood_donation_free_slots_response.dart | 25 + ...blood_donation_projects_list_response.dart | 46 ++ .../service/blood/blood_donation_service.dart | 27 + lib/pages/Blood/blood_donation.dart | 491 ++++++++++++++++- ...donation_appointment_terms_conditions.dart | 43 ++ .../blood_donation_book_appointment.dart | 502 ++++++++++++++++++ .../MyAppointments/AppointmentDetails.dart | 2 + .../widgets/AppointmentActions.dart | 62 +-- lib/pages/ToDoList/ToDo.dart | 16 +- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- lib/widgets/new_design/doctor_header.dart | 79 ++- 14 files changed, 1206 insertions(+), 109 deletions(-) create mode 100644 lib/core/model/blooddonation/blood_donation_free_slots_response.dart create mode 100644 lib/core/model/blooddonation/blood_donation_projects_list_response.dart create mode 100644 lib/pages/Blood/blood_donation_appointment_terms_conditions.dart create mode 100644 lib/pages/Blood/blood_donation_book_appointment.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index a24f0ed2..01c6d755 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:4422/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; +var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; @@ -625,13 +625,17 @@ var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi'; var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; +var GET_BLOOD_DONATION_PROJECTS_LIST = 'Services/OUTPs.svc/REST/BD_getProjectsHaveBDClinics'; + +var GET_BLOOD_DONATION_FREE_SLOTS = 'Services/OUTPs.svc/REST/BD_GetFreeSlots'; + //PAYFORT var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; -var payFortEnvironment = FortEnvironment.production; -var applePayMerchantId = "merchant.com.hmgwebservices"; -// var payFortEnvironment = FortEnvironment.test; -// var applePayMerchantId = "merchant.com.hmgwebservices.uat"; +// var payFortEnvironment = FortEnvironment.production; +// var applePayMerchantId = "merchant.com.hmgwebservices"; +var payFortEnvironment = FortEnvironment.test; +var applePayMerchantId = "merchant.com.hmgwebservices.uat"; class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1f5120bb..b5e1f0d2 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1932,4 +1932,5 @@ const Map localizedValues = { "noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"}, "locationTimeoutError": {"en": "Unable to fetch your location, Please try again.", "ar": "غير قادر على جلب موقعك، يرجى المحاولة مرة أخرى."}, "loadMore": {"en": "Load More", "ar": "تحميل المزيد"}, + "selectHospitalBloodDonation": {"en": "Please select the hospital you want to book an appointment with: ", "ar": "يرجى اختيار المستشفى الذي تريد حجز موعد معه:"}, }; diff --git a/lib/core/model/blooddonation/blood_donation_free_slots_response.dart b/lib/core/model/blooddonation/blood_donation_free_slots_response.dart new file mode 100644 index 00000000..5c46cab1 --- /dev/null +++ b/lib/core/model/blooddonation/blood_donation_free_slots_response.dart @@ -0,0 +1,25 @@ +class BloodDonationFreeSlotsResponseModel { + int clinicID; + int doctorID; + String freeTimeSlots; + int projectID; + + BloodDonationFreeSlotsResponseModel( + {this.clinicID, this.doctorID, this.freeTimeSlots, this.projectID}); + + BloodDonationFreeSlotsResponseModel.fromJson(Map json) { + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + freeTimeSlots = json['FreeTimeSlots']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['FreeTimeSlots'] = this.freeTimeSlots; + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/blooddonation/blood_donation_projects_list_response.dart b/lib/core/model/blooddonation/blood_donation_projects_list_response.dart new file mode 100644 index 00000000..ceb108c5 --- /dev/null +++ b/lib/core/model/blooddonation/blood_donation_projects_list_response.dart @@ -0,0 +1,46 @@ +class BloodDonationProjectsListResponse { + int rowID; + int iD; + int projectID; + int numberOfRooms; + bool isActive; + int createdBy; + String createdOn; + dynamic editedBy; + dynamic editedON; + String projectName; + dynamic projectNameN; + + BloodDonationProjectsListResponse( + {this.rowID, this.iD, this.projectID, this.numberOfRooms, this.isActive, this.createdBy, this.createdOn, this.editedBy, this.editedON, this.projectName, this.projectNameN}); + + BloodDonationProjectsListResponse.fromJson(Map json) { + rowID = json['RowID']; + iD = json['ID']; + projectID = json['ProjectID']; + numberOfRooms = json['NumberOfRooms']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedON = json['EditedON']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['ID'] = this.iD; + data['ProjectID'] = this.projectID; + data['NumberOfRooms'] = this.numberOfRooms; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedON'] = this.editedON; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + return data; + } +} diff --git a/lib/core/service/blood/blood_donation_service.dart b/lib/core/service/blood/blood_donation_service.dart index a59a2169..f73fbe98 100644 --- a/lib/core/service/blood/blood_donation_service.dart +++ b/lib/core/service/blood/blood_donation_service.dart @@ -70,4 +70,31 @@ class BloodDonationService extends BaseService { throw error; } } + + Future getBloodDonationProjectsList() async { + Map request; + request = {}; + dynamic localRes; + await baseAppClient.post(GET_BLOOD_DONATION_PROJECTS_LIST, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(localRes); + } + + Future getBloodDonationFreeSlots(int clinicID, int projectID) async { + Map request; + request = {"ClinicID": clinicID, "ProjectID": projectID}; + dynamic localRes; + await baseAppClient.post(GET_BLOOD_DONATION_FREE_SLOTS, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(localRes); + } + } diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 5e4de7ee..ec39940d 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -1,3 +1,382 @@ +// import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +// import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +// import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; +// import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; +// import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +// import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +// import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; +// import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; +// import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +// import 'package:diplomaticquarterapp/theme/colors.dart'; +// import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +// import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +// import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +// import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +// import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; +// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +// import 'package:diplomaticquarterapp/widgets/show_zoom_image_dialog.dart'; +// import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/material.dart'; +// import 'package:provider/provider.dart'; +// +// enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } +// enum Gender { Male, Female, NON } +// enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON } +// +// class BloodDonationPage extends StatefulWidget { +// @override +// _BloodDonationPageState createState() => _BloodDonationPageState(); +// } +// +// class _BloodDonationPageState extends State { +// BeneficiaryType beneficiaryType = BeneficiaryType.NON; +// +// CitiesModel _selectedHospital; +// +// int _selectedHospitalIndex = 0; +// int _selectedGenderIndex = 1; +// int _selectedBloodTypeIndex = 0; +// String _selectedBloodType = "O+"; +// +// String amount = ""; +// String email; +// +// List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-"); +// AppSharedPreferences sharedPref = AppSharedPreferences(); +// var checkedValue = false; +// List imagesInfo = List(); +// +// ProjectViewModel projectProvider; +// +// @override +// void initState() { +// imagesInfo.add( +// ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'), +// ); +// WidgetsBinding.instance.addPostFrameCallback((_) {}); +// super.initState(); +// } +// +// int getSelectedCityID(MyBalanceViewModel model) { +// int cityID = 1; +// model.CitiesModelList.forEach((element) { +// if (element.description == model.bloodModelList[0].city) { +// cityID = element.iD; +// } +// }); +// return cityID; +// } +// +// @override +// Widget build(BuildContext context) { +// projectProvider = Provider.of(context); +// +// return BaseView( +// onModelReady: (model) => model.getCities().then((value) { +// model.getBlood().then((value) { +// if (model.bloodModelList.length > 0) { +// CitiesModel citiesModel = new CitiesModel(); +// citiesModel.iD = getSelectedCityID(model); +// _selectedHospitalIndex = (citiesModel.iD - 1); +// citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; +// citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; +// _selectedHospital = citiesModel; +// _selectedBloodType = model.bloodModelList[0].bloodGroup; +// _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType); +// } else { +// _selectedHospital = model.CitiesModelList[0]; +// } +// }); +// }), +// // { +// // if (projectProvider.isLogin && projectProvider.user != null) { +// // model.getCities().then((value) { +// // model.getBlood().then((value) { +// // if (model.bloodModelList.length > 0) { +// // CitiesModel citiesModel = new CitiesModel(); +// // citiesModel.iD = getSelectedCityID(model); +// // _selectedHospitalIndex = (citiesModel.iD - 1); +// // citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; +// // citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; +// // _selectedHospital = citiesModel; +// // _selectedBloodType = model.bloodModelList[0].bloodGroup; +// // _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType); +// // } else { +// // _selectedHospital = model.CitiesModelList[0]; +// // } +// // }); +// // }); +// // } +// // }, +// builder: (_, model, w) => AppScaffold( +// isShowAppBar: true, +// showNewAppBar: true, +// backgroundColor: Color(0xffF7F7F7), +// showNewAppBarTitle: true, +// baseViewModel: model, +// isShowDecPage: true, +// imagesInfo: imagesInfo, +// description: TranslationBase.of(context).bloodDonationInfo, +// appBarTitle: TranslationBase.of(context).bloodD, +// body: Column( +// children: [ +// Expanded( +// child: SingleChildScrollView( +// physics: BouncingScrollPhysics(), +// padding: EdgeInsets.all(21), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Text( +// TranslationBase.of(context).bloodDEnterDesc, +// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), +// ), +// SizedBox(height: 12), +// if (projectProvider.isLogin && model.state != ViewState.Busy) +// +// CommonDropDownView( +// TranslationBase.of(context).city, +// model.CitiesModelList.isNotEmpty +// ? projectProvider.isArabic +// ? model.CitiesModelList[_selectedHospitalIndex].descriptionN +// : model.CitiesModelList[_selectedHospitalIndex].description +// : "", () { +// List list = [ +// for (int i = 0; i < model.CitiesModelList.length; i++) +// RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), +// ]; +// +// showDialog( +// context: context, +// builder: (cxt) => RadioSelectionDialog( +// listData: list, +// selectedIndex: _selectedHospitalIndex, +// isScrollable: true, +// onValueSelected: (index) { +// _selectedHospitalIndex = index; +// _selectedHospital = model.CitiesModelList[index]; +// setState(() {}); +// }, +// ), +// ); +// }).withBorderedContainer, +// SizedBox(height: 12), +// CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () { +// List list = [ +// RadioSelectionDialogModel(TranslationBase.of(context).male, 1), +// RadioSelectionDialogModel(TranslationBase.of(context).female, 2), +// ]; +// +// showDialog( +// context: context, +// builder: (cxt) => RadioSelectionDialog( +// listData: list, +// selectedIndex: _selectedGenderIndex, +// onValueSelected: (index) { +// _selectedGenderIndex = index; +// setState(() {}); +// }, +// ), +// ); +// }).withBorderedContainer, +// SizedBox(height: 12), +// CommonDropDownView(TranslationBase.of(context).bloodType, _selectedBloodType, () { +// List list = [ +// RadioSelectionDialogModel("O+", 0), +// RadioSelectionDialogModel("O-", 1), +// RadioSelectionDialogModel("AB+", 2), +// RadioSelectionDialogModel("AB-", 3), +// RadioSelectionDialogModel("A+", 4), +// RadioSelectionDialogModel("A-", 5), +// RadioSelectionDialogModel("B+", 6), +// RadioSelectionDialogModel("B-", 7), +// ]; +// +// showDialog( +// context: context, +// builder: (cxt) => RadioSelectionDialog( +// listData: list, +// selectedIndex: _selectedBloodTypeIndex, +// isScrollable: true, +// onValueSelected: (index) { +// _selectedBloodTypeIndex = index; +// _selectedBloodType = getBlood(index); +// setState(() {}); +// }, +// ), +// ); +// }).withBorderedContainer, +// SizedBox(height: 12), +// Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Text( +// TranslationBase.of(context).viewTermsConditions + ":", +// style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56), +// ), +// InkWell( +// onTap: () { +// Navigator.of(context).push(FadePage(page: UserAgreementPage())); +// }, +// child: Text( +// TranslationBase.of(context).clickHere, +// style: TextStyle(fontWeight: FontWeight.w600, color: Colors.blue, fontSize: 14, letterSpacing: -0.56), +// ), +// ) +// ], +// ), +// SizedBox(height: 12), +// Row( +// children: [ +// Checkbox( +// onChanged: (bool value) { +// setState(() { +// checkedValue = value; +// }); +// }, +// value: checkedValue, +// activeColor: Color(0xFFc5272d), +// ), +// Text( +// TranslationBase.of(context).iAgreeToTheTermsAndConditions, +// style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), +// ), +// ], +// ), +// SizedBox( +// height: 10, +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.center, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Center( +// child: Container( +// color: Theme.of(context).primaryColor, +// width: 350, +// child: InkWell( +// onTap: () { +// showZoomImageDialog(context, 'assets/images/BloodChrt_EN.png', isNetworkImage: false); +// }, +// child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white), +// ), +// ), +// ), +// ], +// ), +// SizedBox( +// height: MediaQuery.of(context).size.height * 0.15, +// ) +// ], +// ), +// ), +// ), +// DefaultButton( +// TranslationBase.of(context).save, +// checkedValue +// ? () async { +// if (_selectedHospital == null) { +// AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); +// return; +// } +// bloodDetails.city = _selectedHospital.description; +// bloodDetails.cityCode = _selectedHospital.iD.toString(); +// bloodDetails.gender = _selectedGenderIndex; +// bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex); +// await model.updateBloodGroup(bloodDetails); +// if (model.state == ViewState.Idle) { +// AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); +// } else { +// AppToast.showErrorToast(message: model.error); +// } +// } +// : null, +// disabledColor: CustomColors.grey2, +// ).insideContainer +// ], +// ), +// ), +// ); +// } +// +// String getBlood(int index) { +// switch (index) { +// case 0: +// return "O+"; +// break; +// case 1: +// return "O-"; +// break; +// case 2: +// return "AB+"; +// break; +// case 3: +// return "AB-"; +// break; +// case 4: +// return "A+"; +// break; +// case 5: +// return "A-"; +// break; +// case 6: +// return "B-"; +// break; +// case 7: +// return "B-"; +// break; +// case 8: +// return "B+"; +// break; +// +// default: +// return ""; +// } +// } +// +// int getBloodIndex(String type) { +// switch (type) { +// case "O+": +// return 0; +// break; +// case "O-": +// return 1; +// break; +// case "AB+": +// return 2; +// break; +// case "AB-": +// return 3; +// break; +// case "A+": +// return 4; +// break; +// case "A-": +// return 5; +// break; +// case "B-": +// return 6; +// break; +// case "B-": +// return 7; +// break; +// case "B+": +// return 8; +// break; +// +// default: +// return 0; +// } +// } +// +// String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { +// if (_selectedHospital != null) +// return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; +// else +// return TranslationBase.of(context).selectCity; +// } +// } import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; @@ -5,12 +384,15 @@ import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dar import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; +import 'package:diplomaticquarterapp/pages/Blood/blood_donation_book_appointment.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -21,7 +403,9 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + enum Gender { Male, Female, NON } + enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON } class BloodDonationPage extends StatefulWidget { @@ -134,7 +518,6 @@ class _BloodDonationPageState extends State { ), SizedBox(height: 12), if (projectProvider.isLogin && model.state != ViewState.Busy) - CommonDropDownView( TranslationBase.of(context).city, model.CitiesModelList.isNotEmpty @@ -272,28 +655,90 @@ class _BloodDonationPageState extends State { ), ), ), - DefaultButton( - TranslationBase.of(context).save, - checkedValue - ? () async { - if (_selectedHospital == null) { - AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); - return; - } - bloodDetails.city = _selectedHospital.description; - bloodDetails.cityCode = _selectedHospital.iD.toString(); - bloodDetails.gender = _selectedGenderIndex; - bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex); - await model.updateBloodGroup(bloodDetails); - if (model.state == ViewState.Idle) { - AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); - } else { - AppToast.showErrorToast(message: model.error); - } - } - : null, - disabledColor: CustomColors.grey2, - ).insideContainer + Container( + color: CustomColors.appBackgroudGreyColor, + margin: EdgeInsets.all(14), + height: 45.0, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: CustomTextButton( + backgroundColor: CustomColors.green, + elevation: 0, + onPressed: () { + Navigator.push(context, FadePage(page: BloodDonationBookAppointment())); + }, + child: Text(TranslationBase.of(context).bookAppo.toUpperCase(), + style: TextStyle( + fontSize: 16.0, + color: Colors.white, + )), + ), + ), + ), + mWidth(7), + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: CustomTextButton( + backgroundColor: Color(0xffc5272d), + elevation: 0, + onPressed: () async { + if (_selectedHospital == null) { + AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); + return; + } + bloodDetails.city = _selectedHospital.description; + bloodDetails.cityCode = _selectedHospital.iD.toString(); + bloodDetails.gender = _selectedGenderIndex; + bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex); + await model.updateBloodGroup(bloodDetails); + if (model.state == ViewState.Idle) { + AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); + } else { + AppToast.showErrorToast(message: model.error); + } + }, + child: Text(TranslationBase.of(context).save.toUpperCase(), style: TextStyle(fontSize: 16.0, color: Colors.white)), + ), + ), + ), + ], + ), + ), + // DefaultButton( + // TranslationBase.of(context).save, + // checkedValue + // ? () async { + // if (_selectedHospital == null) { + // AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); + // return; + // } + // bloodDetails.city = _selectedHospital.description; + // bloodDetails.cityCode = _selectedHospital.iD.toString(); + // bloodDetails.gender = _selectedGenderIndex; + // bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex); + // await model.updateBloodGroup(bloodDetails); + // if (model.state == ViewState.Idle) { + // AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); + // } else { + // AppToast.showErrorToast(message: model.error); + // } + // } + // : null, + // disabledColor: CustomColors.grey2, + // ).insideContainer ], ), ), diff --git a/lib/pages/Blood/blood_donation_appointment_terms_conditions.dart b/lib/pages/Blood/blood_donation_appointment_terms_conditions.dart new file mode 100644 index 00000000..54c7a336 --- /dev/null +++ b/lib/pages/Blood/blood_donation_appointment_terms_conditions.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:provider/provider.dart'; + +class BloodDonationAppointmentTermsConditions extends StatelessWidget { + String contentEN = + ' DONOR EDUCATION

                                 

DONOR EDUCATION

Why Should I Give Blood?

Because You Can Make a Difference!

Learning more about blood donation and knowing

DEAR DONOR:

This information sheet explains how YOU can help us make the donation process safe for yourself and patients who might receive your blood.

 

PLEASE READ THIS INFORMATION BEFORE YOU DONATE!

ACCURACY & HONESTY ARE ESSENTIAL!

Your complete honesty in answering all questions is very important for the safety of patients who receive your blood. All information you provide is confidential.

 

DONATION RISKS (These are not common 1-2%) Some of the risks and/or problems associated with donating include: dizziness or lightheadedness, nausea and/or vomiting, rapid pulse rate, Itching at the site from an allergy to iodine, bruising (hematoma), pain at the site.

 

  1. DONOR ELIGIBILITY

YOU MAY DONATE :

  1.          If  you are 18 years old or older (17 with parental permission) and weigh at least 110 pounds (50 kg)
  2.          If  you are in good health
  3.          Have not donated whole blood in the past 8 weeks
  4.          Have not donated double red cells in the past 16 weeks

YOU MAY NOT DONATE IF YOU:

  1.          Have had AIDS or a Positive HIV test
  2.          Have participated in activities that put you at risk for acquiring AIDS.

 

Why we ask questions about sexual contact (as required by federal regulations)

Sexual contact may cause contagious diseases like HIV to get into the blood stream and be spread through transfusions to someone else.

PLEASE DO NOT DONATE TO GET AN HIV TEST DONE

  1. DONATION PROCESS
  1.       Registration: PHOTO ID must be presented prior to donation to identify you at every donation.
  2.       Interview: to determine if you are all right to donate we will:
  • Ask questions about health, travel and medicines.
  • Ask questions to see if you might be at risk for hepatitis, HIV or AIDS
  1.       Mini-physical Examination
  • Take your blood pressure, pulse, temperature, weight.
  • Take a small blood sample to make sure your Hemoglobin level is normal.
  1.      Phlebotomy
  • You will be seated in a donor chair, a tourniquet will be applied to your arm, and a suitable vein located.
  • The site will be cleaned with an antiseptic
  • A sterile needle will be gently inserted into your vein and the blood will be collected in a sterile bag for 5-15 minutes
  • After donation, a pressure bandage will be applied to the site and you may rest and enjoy some refreshments.

 

WHAT HAPPENS AFTER YOUR DONATION?

 

  1. Your blood is tested for: HepatitisB and C, HIV, HTLV (associated with a virus that causes    leukemia), Syphilis, Malaria, Sickling and Blood Type.
  2. There are certain conditions like in Emergency situation; there is a chance that your unit is released without completion of infectious disease testing.
  3. If your blood tests Positive it will not be given to a patient. Your blood will be discarded.
  4. You will be notified about test results that may disqualify you from donating in the future. Since confirmatory tests are necessary, it may take up few days before notification.
  5. If your blood tests Positive, your name will be put on a confidential list of Deferred Donors. When required, Blood Bank will report your donor information, including test result, to health departments and regulatory agencies as required by law.
  6. To ensure confidentiality, NO test results (including blood type) will be given by phone. Written approval from you will be required before test results are released.

 

CARE AFTER DONATING

 

When you donate blood, your body needs a few minutes to adjust to the slight change in blood fluid volume. It is important to follow these instructions:

  1. Remain lying on the donor chair until a staff member releases you to the refreshment area.
  2. Remain in the refreshment area for at least 10 minutes. Enjoy juice and a snack. If you cannot stay, please notify donor room staff.
  3. Drink more fluid than usual and eat heartily for today.
  4. Avoid smoking for 2 hours
  5. Refrain from strenuous exercise for 24 hours. If safety risks are a normal part of your routine, ask a donor room staff member how long you should wait before resuming regular activities.
  6. If you become light-headed or dizzy, lie down until the feeling disappears. If the feeling continues, contact Blood Bank or your physician.
  7. Leave your bandage in place for 4 to 5 hours. This will help to prevent bruising. If your arm starts bleeding again, apply direct pressure and elevate your arm.
  8. Make sure you’re eating a nutritious, well-balance diet containing foods rich in iron and high in vitamin C.
  9. However, if you are a frequent donor, iron rich foods in your diet may not be enough to replenish the iron you routinely lose through blood donations. We recommend you to consult with your health-care provider to see if taking an iron supplement is right for you.

 

If after donating, you realize that you should not have donated because of previous Risk Factors, behaviors, or diseases, YOUR BLOOD MUST NOT BE USED FOR TRANSFUSION!

PLEASE CONTACT Blood Bank IMMEDIATELY.

 

 

 

If you become ill within the next 72 hours, or think of any reason your blood should not be transfused, Please call Blood Bank at +966-11-4833672 or Ext 3662.

 

 

 

 

THANK YOU FOR GIVING

THE GIFT OF LIFE!

 

 

 

BB Form 091 - Donor Education Material (English)          HMG/QID/1892

'; + + String contentAR = + '

ﺗﺜﻘﯿﻒ اﻟﻤﺘﺒﺮع

لماذا علي أن أتبرع بالدم؟ أنك تستطیع أن تحدث فرق تعلم أكثر عن التبرع بالدم


ﻣﺎذا ﯾﺤﺪث ﺑﻌﺪ اﻟﺘﺒﺮع ﺑﺎﻟﺪم؟

-1 ﯾﺘﻢ ﻓﺤﺺ اﻻﯾﺪز ، ﻓﯿﺮوس اﻟﻜﺒﺪ اﻟﻮﺑﺎﺋﻲ ب و ج ، ﻓﯿﺮوس ﻛﺮﯾﺎت اﻟﺪم اﻟﺒﯿﻀﺎء )ﻣﺮﺗﺒﻂ ﺑﻔﯿﺮوس ﺗﺴﺒﺐ ﺳﺮطﺎن اﻟﺪم(

،اﻟﺰھﺮي ، اﻻﻧﯿﻤﯿﺎ اﻟﻤﻨﺠﻠﯿﺔ ،ﻓﺼﯿﻠﺔ اﻟﺪم و اﻻﺟﺴﺎم اﻟﻤﻀﺎدة.

-2 ﻓﻲ ﺣﺎل اﻟﻨﺘﯿﺠﺔ ﻛﺎﻧﺖ اﯾﺠﺎﺑﯿﺔ ﻻي ﻣﺮض ﻣﻦ اﻷﻣﺮاض اﻟﺴﺎﺑﻘﺔ ﻧﻘﻮم ﺑﺎﻟﺘﺨﻠﺺ ﻣﻦ اﻟﺪم ﻣﺒﺎﺷﺮة وﻻ ﯾﻌﻄﻰ ﻟﻠﻤﺮﯾﺾ وﯾﺘﻢ

اﺑﻼغ اﻟﻤﺘﺒﺮع ﻷﺧﺬ ﻋﯿﻨﺔ اﺧﺮى ﻟﻠﺘﺄﻛﺪ . وﻓﻲ ﺣﺎل وﺟﻮد ﻣﺮض ﯾﻤﻨﻊ اﻟﺘﺒﺮع ﻓﻲ اﻟﻤﺴﺘﻘﺒﻞ وﯾﺘﻢ اﺑﻼغ اﻟﻤﺘﺒﺮع.

-3 ﻓﻲ ﺣﺎل وﺟﻮد ﻣﺮض ﯾﻤﻨﻊ ﻣﻦ اﻟﺘﺒﺮع ﻣﺴﺘﻘﺒﻼ ﯾﺴﺠﻞ اﺳﻢ اﻟﻤﺘﺒﺮع ﻓﻲ ﻗﺎﺋﻤﺔ اﻟﻤﺘﺒﺮﻋﯿﻦ اﻟﻤﺮﻓﻮﺿﯿﯿﻦ ﻟﺪى ﺑﻨﻚ اﻟﺪم ﻣﻊ

ﻣﻌﻠﻮﻣﺎﺗﮫ وﻧﺘﯿﺠﺔ اﻟﻔﺤﺺ وﺗﻌﻄﻲ اﻟﻤﻌﻠﻮﻣﺎت ﻟﻠﺠﮭﺎت اﻟﻤﺨﺘﺼﺔ إذا طُﻠﺒﺖ ﻗﺎﻧﻮﻧﯿﺎً.

-4 ﻟﺴﺮﯾﺔ ﻧﺘﺎﺋﺞ اﻟﻔﺤﻮﺻﺎت ﺗﻌﻄﻲ اي ﻧﺘﯿﺠﺔ ﺑﺎﻟﮭﺎﺗﻒ وﯾﺠﺐ ﺣﻀﻮر اﻟﻤﺮﯾﺾ ﻣﻊ اﺛﺒﺎﺗﮫ ﻷﺧﺬ اﻟﻨﺘﯿﺠﺔ.

اﺣﺘﯿﺎطﺎت اﻟﺴﻼﻣﺔ ﺑﻌﺪ اﻟﺘﺒﺮع:

ﺑﻌﺪ اﻟﺘﺒﺮع ﺑﺎﻟﺪم ﺟﺴﻤﻚ ﯾﺤﺘﺎج ﻟﺒﻌﺾ اﻟﻮﻗﺖ ﻟﻠﺮاﺣﺔ ﻟﯿﺘﻢ ﺿﺒﻂ اﻟﺘﻐﯿﺮ ﻓﻲ اﻟﺴﻮاﺋﻞ اﻟﺪم ﻟﺬﻟﻚ ﻧﺮﺟﻮ اﺗﺒﺎع اﻻرﺷﺎدات

اﻟﺘﺎﻟﯿﺔ:

 

ﺑﻌﺪ اﻟﺘﺒﺮع ﻣﺒﺎﺷﺮة ﺗﻐﺎدر ﻛﺮﺳﻲ اﻟﺘﺒﺮع اﻻﺑﻌﺪ ارﺷﺎدك ﻣﻦ ﻗﺒﻞ اﻟﻌﺎﻣﻠﯿﻦ ﻟﺘﺠﻠﺲ ﻓﻲ ﻣﻜﺎن

-1

ﻣﺨﺼﺺ ﻟﻠﺮاﺣﺔ

 

اﻟﺠﻠﻮس ﻓﻲ اﻟﻤﻜﺎن اﻟﻤﺨﺼﺺ ﻟﻠﺮاﺣﺔ ﻟﻤﺪة 10 دﻗﺎﺋﻖ ﻣﻊ ﺷﺮب اﻟﻌﺼﯿﺮ واﻟﻤﺎء وﻓﻲ ﺣﺎل رﻏﺒﺘﻚ

-2

ﺑﺎﻟﻤﻐﺎدرة اﻟﺮﺟﺎء اﺧﺒﺎر أﺣﺪ اﻟﻌﺎﻣﻠﯿﻦ.

 

اﻟﺮﺟﺎء ﺷﺮب ﻛﻤﯿﺔ ﻛﺒﯿﺮة ﻣﻦ اﻟﺴﻮاﺋﻞ أﻛﺜﺮ ﻣﻦ اﻟﻤﻌﺘﺎد وﺗﻨﺎول طﻌﺎم ﺻﺤﻲ ﻟﺬﻟﻚ اﻟﯿﻮم.

-3

ﺗﺠﻨﺐ اﻟﺘﺪﺧﯿﻦ ﻟﻤﺪة ﺳﺎﻋﺘﯿﻦ ﺑﻌﺪ اﻟﺘﺒﺮع.

-4

ﺗﺠﻨﺐ اﻻﺟﮭﺎد أو اﻟﻨﺸﺎطﺎت اﻟﻘﻮﯾﺔ ﻟﻤﺪة 24 ﺳﺎﻋﺔ، اﻣﺎ إذا ﻛﺎن ﻟﺪﯾﻚ ﻧﺸﺎطﺎت آﻣﻨﺔ ﺑﺼﻮرة دورﯾﺔ

-5

اﻟﺮﺟﺎء اﻻﺳﺘﻔﺴﺎر ﻣﻦ اﻟﻌﺎﻣﻠﯿﻦ ﻓﻲ وﺣﺪة اﻟﺘﺒﺮع ﺑﺎﻟﺪم.

 

ﻟﻮ ﺷﻌﺮت ﺑﺎﻟﺪوار ﺑﻌﺪ ﻣﻐﺎدرﺗﻚ وﺣﺪة اﻟﺘﺒﺮع ﯾﺠﺐ وﺿﻊ رأﺳﻚ إﻟﻰ اﻻﺳﻔﻞ وﻗﺪﻣﯿﻚ إﻟﻰ اﻷﻋﻠﻰ

-6

ﺣﺘﻰ ﺗﺸﻌﺮ ﺑﺎﻟﺮاﺣﺔ وﻓﻲ ﺣﺎﻟﺔ ﻋﺪم ﺷﻌﻮرك ﺑﺎﻟﺮاﺣﺔ اﻟﺮﺟﺎء اﻟﺘﻮاﺻﻞ ﻣﻊ وﺣﺪة اﻟﺘﺒﺮع ﺑﺎﻟﺪم أو

 

اﻟﺘﺤﺪث ﻣﻊ طﺒﯿﺒﻚ.

 

اﺳﺤﺐ اﻟﻠﺼﻘﺔ ﻣﻦ ﻣﻜﺎن اﻟﺘﺒﺮع ﺑﻌﺪ 4 إﻟﻰ 5 ﺳﺎﻋﺎت ﻣﻦ اﻟﺘﺒﺮع ﻟﺘﺠﻨﺐ ﻧﺰﯾﻒ اﻟﺪم وإذا ﻧﺰف اﻟﺪم

-7

ﻗﻢ ﺑﻮﺿﻌﮭﺎ ﻓﻲ ﻣﻜﺎﻧﮭﺎ ﻣﺮة اﺧﺮى وارﻓﻊ ﯾﺪك إﻟﻰ اﻻﻋﻠﻰ.

 

اﺣﺮص ﻋﻠﻰ اﻟﺤﺼﻮل ﻋﻠﻰ وﺟﺒﺎت ﻏﻨﯿﺔ وﺻﺤﯿﺔ وإذا ﻛﻨﺖ ﺗﺘﺒﻊ ﺣﻤﯿﺔ ﻏﺬاﺋﯿﺔ اﺣﺮص ﻋﻠﻰ أن

-8

ﺗﻜﻮن ﺣﻤﯿﺘﻚ ﻣﺤﺘﻮﯾﺔ ﻋﻠﻰ ﻧﺴﺒﺔ ﻋﺎﻟﯿﺔ ﻣﻦ اﻟﺤﺪﯾﺪ وﻓﯿﺘﺎﻣﯿﻦ ﺳﻲ، ﻋﻠﻰ ﻛﻞ ﺣﺎل إذا ﻛﻨﺖ ﻣﻦ

 

اﻟﻤﺘﺒﺮﻋﯿﻦ اﻟﺪاﺋﻤﯿﻦ ﻓﺈن ﺣﻤﯿﺘﻚ اﻟﻐﺬاﺋﯿﺔ ﻗﺪ ﻻﺗﻜﻮن ﻛﺎﻓﯿﺔ ﻟﺘﻌﻮﯾﺾ ﺟﺴﻤﻚ ﻣﺎ ﯾﻔﻘﺪه ﻣﻦ ﺣﺪﯾﺪ ﻋﻨﺪ

 

ﺗﺒﺮﻋﻚ ﺑﺎﻟﺪم وﻧﻨﺼﺤﻚ ﺑﻤﺮاﺟﻌﺔ أﺧﺼﺎﺋﻲ اﻟﺮﻋﺎﯾﺔ اﻟﺼﺤﯿﺔ ﻟﯿﻘﺮر إذا ﻛﻨﺖ ﺗﺤﺘﺎج إﻟﻰ ﻣﻜﻤﻞ ﻏﺬاﺋﻲ

 

ﻣﺤﺘﻮي ﻋﻠﻰ اﻟﺤﺪﯾﺪ.

 

إذا أدرﻛﺖ ﺑﻌﺪ اﻟﺘﺒﺮع أﻧﻚ ﻗﺪ ﻗﻤﺖ ﺑﻨﺸﺎطﺎت أو ﺗﻌﺮﺿﺖ ﻷﻣﺮاض أو ﺳﻠﻮك ﯾﻤﻨﻌﻚ ﻣﻦ اﻟﺘﺒﺮع ﻧﺮﺟﻮ اﻻﺗﺼﺎل

ﺑﺒﻨﻚ اﻟﺪم ﻟﻌﻤﻞ اﻻﺣﺘﯿﺎطﺎت اﻟﻼزﻣﺔ ﻟﻤﻨﻊ ﻧﻘﻞ دﻣﻚ ﻻي ﻣﺮﯾﺾ. وﻟﻮ ﺷﻌﺮت ﺑﻌﺪ 72ﺳﺎﻋﺔ أﻧﻚ ﺑﺤﺎﻟﺔ ﻏﯿﺮ ﺟﯿﺪة أو دﻣﻚ ﯾﺠﺐ أن ﯾﻌﻄﻰ ﻻي ﻣﺮﯾﺾ ﻻي ﺳﺒﺐ ﻣﻦ اﻷﺳﺒﺎب

ﯾﺠﺐ اﻻﺗﺼﺎل ﺑﺒﻨﻚ اﻟﺪم

(+966114833672)واﻟﺘﺤﻮﯾﻠﺔ ھﻲ 3662

ﺷﻜﺮا ﻟﻌﻄﺎﺋﻚ..

ﻓﻌﻄﺎﺋﻚ ھﻮ ﺣﯿﺎة..

 

'; + + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + showNewAppBar: true, + backgroundColor: Color(0xffF7F7F7), + showNewAppBarTitle: true, + description: TranslationBase.of(context).bloodDonationInfo, + appBarTitle: TranslationBase.of(context).bloodD, + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Html( + data: projectViewModel.isArabic ? contentAR : contentEN, + shrinkWrap: true, + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/Blood/blood_donation_book_appointment.dart b/lib/pages/Blood/blood_donation_book_appointment.dart new file mode 100644 index 00000000..dd3fd6db --- /dev/null +++ b/lib/pages/Blood/blood_donation_book_appointment.dart @@ -0,0 +1,502 @@ +import 'package:diplomaticquarterapp/core/model/blooddonation/blood_donation_free_slots_response.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/blood_donation_projects_list_response.dart'; +import 'package:diplomaticquarterapp/core/service/blood/blood_donation_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; +import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; +import 'package:diplomaticquarterapp/pages/Blood/blood_donation_appointment_terms_conditions.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/theme/colors.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/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.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:intl/intl.dart'; +import 'package:provider/provider.dart'; +import 'package:syncfusion_flutter_calendar/calendar.dart'; + +import '../AlHabibMedicalService/h2o/h20_setting.dart'; + +class BloodDonationBookAppointment extends StatefulWidget { + const BloodDonationBookAppointment(); + + static bool areSlotsAvailable = false; + static DateTime selectedAppoDateTime; + static String selectedDate; + static String selectedTime; + + @override + State createState() => _BloodDonationBookAppointmentState(); +} + +class _BloodDonationBookAppointmentState extends State with TickerProviderStateMixin { + Map _events; + AnimationController _animationController; + CalendarController _calendarController; + + List bloodDonationProjectsListResponse = []; + int _selectedProjectID = 0; + int _clinicID = 0; + int _doctorID = 0; + + String selectedProjectName = ""; + + List docFreeSlots = []; + List dayEvents = []; + + var selectedDate = ""; + dynamic selectedDateJSON; + dynamic jsonFreeSlots; + + int selectedButtonIndex = 0; + + List bloodDonationFreeSlotsResponse = []; + + ProjectViewModel projectViewModel; + ScrollController _scrollController; + + var checkedValue = false; + + @override + void initState() { + final _selectedDay = DateTime.now(); + super.initState(); + + _events = { + _selectedDay: ['Event A0'] + }; + + _scrollController = new ScrollController(); + + _calendarController = CalendarController(); + _animationController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 50), + ); + + WidgetsBinding.instance.addPostFrameCallback((_) { + getBloodDonationProjectsList(); + }); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + showNewAppBar: true, + backgroundColor: Color(0xffF7F7F7), + showNewAppBarTitle: true, + isShowDecPage: true, + description: TranslationBase.of(context).bloodDonationInfo, + appBarTitle: TranslationBase.of(context).bloodD, + body: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationBase.of(context).selectHospitalBloodDonation, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)), + mHeight(12), + CommonDropDownView( + TranslationBase.of(context).selectProject, + selectedProjectName, + () { + List list = []; + bloodDonationProjectsListResponse.forEach((element) { + list.add(RadioSelectionDialogModel(element.projectName, element.projectID)); + }); + showDialog( + context: context, + builder: (cxt) => RadioSelectionDialog( + listData: list, + selectedIndex: 0, + onValueSelected: (index) { + print(index); + _selectedProjectID = index; + selectedProjectName = bloodDonationProjectsListResponse.firstWhere((element) => element.projectID == index).projectName; + getBloodDonationFreeSlots(); + setState(() {}); + }, + ), + ); + }, + ).withBorderedContainer, + mHeight(12), + Container( + decoration: cardRadius(12), + child: _buildTableCalendarWithBuilders(projectViewModel), + ), + mHeight(12), + Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)), + mHeight(8), + BloodDonationBookAppointment.areSlotsAvailable + ? Container( + height: 40, + child: ListView.builder( + controller: _scrollController, + scrollDirection: Axis.horizontal, + itemCount: dayEvents.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide( + color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border + style: BorderStyle.solid, //Style of the border + width: 1.5, //width of the border + ), + ), + minWidth: MediaQuery.of(context).size.width * 0.2, + child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)), + ); + }, + ), + ) + : Center( + child: Padding( + padding: const EdgeInsets.only(left: 12.0, right: 12.0), + child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)), + ), + ), + SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).viewTermsConditions + ":", + style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56), + ), + InkWell( + onTap: () { + Navigator.of(context).push(FadePage(page: BloodDonationAppointmentTermsConditions())); + }, + child: Text( + TranslationBase.of(context).clickHere, + style: TextStyle(fontWeight: FontWeight.w600, color: Colors.blue, fontSize: 14, letterSpacing: -0.56), + ), + ) + ], + ), + SizedBox(height: 12), + Row( + children: [ + Checkbox( + onChanged: (bool value) { + setState(() { + checkedValue = value; + }); + }, + value: checkedValue, + activeColor: Color(0xFFc5272d), + ), + Text( + TranslationBase.of(context).iAgreeToTheTermsAndConditions, + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), + ), + ], + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.081, + width: double.infinity, + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: DefaultButton( + TranslationBase.of(context).bookAppo, + () async { + if (BloodDonationBookAppointment.areSlotsAvailable) { + if (checkedValue) { + insertBloodDonationAppointment(); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); + } + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot); + } + }, + textColor: Colors.white, + color: CustomColors.green, + ), + ), + ], + ), + ), + ); + } + + void insertBloodDonationAppointment() { + DoctorsListService service = new DoctorsListService(); + final timeSlot = BloodDonationBookAppointment.selectedAppoDateTime; + GifLoaderDialogUtils.showMyDialog(context); + service + .insertAppointment(_doctorID, _clinicID, _selectedProjectID, BloodDonationBookAppointment.selectedTime, BloodDonationBookAppointment.selectedDate, 45, projectViewModel.isArabic ? 1 : 2, + context, null, null, null, projectViewModel) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); + Navigator.of(context).pop(); + } else { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () async { + // openAppSettings(); + Navigator.pop(context); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + // AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: err, + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () async { + // openAppSettings(); + Navigator.pop(context); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + }); + } + + void _onDaySelected(DateTime day, ProjectViewModel projectViewModel) { + final DateFormat formatter = DateFormat('yyyy-MM-dd'); + setState(() { + this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en"); + openTimeSlotsPickerForDate(day, docFreeSlots); + BloodDonationBookAppointment.selectedDate = formatter.format(day); + _calendarController.selectedDate = day; + print(BloodDonationBookAppointment.selectedDate); + }); + } + + Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) { + return SfCalendar( + controller: _calendarController, + minDate: DateTime.now(), + showNavigationArrow: true, + headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)), + viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)), + view: CalendarView.month, + todayHighlightColor: CustomColors.green, + selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5), + cellBorderColor: Colors.white, + dataSource: MeetingDataSource(_getDataSource()), + monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1), + onTap: (CalendarTapDetails details) { + _calendarController.selectedDate = details.date; + _onDaySelected(details.date, projectViewModel); + }, + ); + } + + Widget getNormalButton(int index) { + return CustomTextButton( + backgroundColor: Colors.white, + elevation: 0, + side: BorderSide( + color: Colors.black, //Color of the border + style: BorderStyle.solid, //Style of the border + width: 1.5 //width of the border + ), + onPressed: () { + final timeslot = dayEvents[index]; + BloodDonationBookAppointment.selectedAppoDateTime = timeslot.end; + + setState(() { + selectedButtonIndex = index; + BloodDonationBookAppointment.selectedTime = dayEvents[index].isoTime; + print(BloodDonationBookAppointment.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, color: Color(0xFF60686b))), + ); + } + + Widget getSelectedButton(int index) { + return CustomTextButton( + backgroundColor: CustomColors.green, + elevation: 0, + side: BorderSide( + color: CustomColors.green, //Color of the border + style: BorderStyle.solid, //Style of the border + width: 1.5 //width of the border + ), + onPressed: () { + setState(() { + selectedButtonIndex = index; + BloodDonationBookAppointment.selectedTime = dayEvents[index].isoTime; + print(BloodDonationBookAppointment.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, color: Colors.white)), + ); + } + + getBloodDonationFreeSlots() { + BloodDonationService service = new BloodDonationService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getBloodDonationFreeSlots(134, _selectedProjectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res["MessageStatus"] == 1) { + res['BD_FreeSlots'].forEach((element) { + bloodDonationFreeSlotsResponse.add(BloodDonationFreeSlotsResponseModel.fromJson(element)); + }); + print(bloodDonationFreeSlotsResponse.length); + _getJSONSlots().then((value) => { + setState(() => {_clinicID = bloodDonationFreeSlotsResponse[0].clinicID, _doctorID = bloodDonationFreeSlotsResponse[0].doctorID, _events.clear(), _events = value}) + }); + } else { + AppToast.showErrorToast(message: res["ErrorEndUserMessage"]); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + openTimeSlotsPickerForDate(DateTime dateStart, List freeSlots) { + dayEvents.clear(); + DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0); + + freeSlots.forEach((v) { + if (v.start == dateStartObj) dayEvents.add(v); + }); + + setState(() { + if (dayEvents.length != 0) { + BloodDonationBookAppointment.areSlotsAvailable = true; + selectedButtonIndex = 0; + BloodDonationBookAppointment.selectedTime = dayEvents[selectedButtonIndex].isoTime; + } else + BloodDonationBookAppointment.areSlotsAvailable = false; + }); + } + + Future> _getJSONSlots() async { + Map _eventsParsed; + List slotsList = []; + DateTime date; + final DateFormat formatter = DateFormat('HH:mm'); + final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); + for (var i = 0; i < bloodDonationFreeSlotsResponse.length; i++) { + date = DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[i].freeTimeSlots); + slotsList.add(FreeSlot(date, ['slot'])); + docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date)); + } + _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); + setState(() { + BloodDonationBookAppointment.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[0].freeTimeSlots)); + selectedDate = DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[0].freeTimeSlots)); + selectedDateJSON = bloodDonationFreeSlotsResponse[0].freeTimeSlots; + }); + openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); + _calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON); + return _eventsParsed; + } + + getBloodDonationProjectsList() { + BloodDonationService service = new BloodDonationService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getBloodDonationProjectsList().then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['BD_getProjectsHaveBDClinics']); + if (res["MessageStatus"] == 1) { + res['BD_getProjectsHaveBDClinics'].forEach((element) { + bloodDonationProjectsListResponse.add(BloodDonationProjectsListResponse.fromJson(element)); + }); + print(bloodDonationProjectsListResponse.length); + } else { + AppToast.showErrorToast(message: res["ErrorEndUserMessage"]); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + List _getDataSource() { + final List meetings = []; + _events.forEach((key, value) { + final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0); + final DateTime endTime = startTime.add(const Duration(minutes: 20)); + meetings.add(Meeting("", startTime, endTime, CustomColors.green, false)); + }); + return meetings; + } +} + +class MeetingDataSource extends CalendarDataSource { + MeetingDataSource(List source) { + appointments = source; + } + + @override + DateTime getStartTime(int index) { + return _getMeetingData(index).from; + } + + @override + DateTime getEndTime(int index) { + return _getMeetingData(index).to; + } + + @override + String getSubject(int index) { + return _getMeetingData(index).eventName; + } + + @override + Color getColor(int index) { + return _getMeetingData(index).background; + } + + @override + bool isAllDay(int index) { + return _getMeetingData(index).isAllDay; + } + + Meeting _getMeetingData(int index) { + final dynamic meeting = appointments[index]; + Meeting meetingData; + if (meeting is Meeting) { + meetingData = meeting; + } + return meetingData; + } +} + +class Meeting { + Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay); + + String eventName; + DateTime from; + DateTime to; + Color background; + bool isAllDay; +} diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 362320eb..ed1f9b31 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -120,6 +120,7 @@ class _AppointmentDetailsState extends State with SingleTick widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || + widget.appo.clinicID == 134 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false @@ -157,6 +158,7 @@ class _AppointmentDetailsState extends State with SingleTick widget.appo.clinicID == 23 || widget.appo.clinicID == 253 || widget.appo.clinicID == 265 || + widget.appo.clinicID == 134 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { _tabController.index = _tabController.previousIndex; diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 0135ac19..474e3333 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -74,7 +74,7 @@ class _AppointmentActionsState extends State { shrinkWrap: true, itemBuilder: (context, index) { // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); - bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || + bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 134) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || (Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) && widget.appo.clinicID == 10 && @@ -83,8 +83,8 @@ class _AppointmentActionsState extends State { onTap: shouldEnable ? null : () { - _handleButtonClicks(appoButtonsList[index], model); - }, + _handleButtonClicks(appoButtonsList[index], model); + }, child: MedicalProfileItem( title: appoButtonsList[index].title, imagePath: appoButtonsList[index].icon, @@ -133,7 +133,7 @@ class _AppointmentActionsState extends State { locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'add reminder'); break; case "goToTodoList": - // Navigator.of(context).pop(); + // Navigator.of(context).pop(); navigateToToDoPage(context, model); locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'todo list'); break; @@ -506,22 +506,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) {}) + 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) {}) .then((value) { print("Dialog Closed"); print(value); @@ -576,10 +576,10 @@ class _AppointmentActionsState extends State { context, FadePage( page: VitalSignDetailsScreen( - appointmentNo: appoNo, - projectID: projectID, - isNotOneAppointment: false, - ))); + appointmentNo: appoNo, + projectID: projectID, + isNotOneAppointment: false, + ))); } navigateToInsertComplaint() { @@ -587,9 +587,9 @@ class _AppointmentActionsState extends State { context, FadePage( page: FeedbackHomePage( - messageType: MessageType.ComplaintOnAnAppointment, - appointment: widget.appo, - ))); + messageType: MessageType.ComplaintOnAnAppointment, + appointment: widget.appo, + ))); } navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { @@ -604,10 +604,10 @@ class _AppointmentActionsState extends State { context, FadePage( page: ToDo( - isShowAppBar: true, - isFromMyAppointments: true, - appointment: widget.appo, - ))); + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index c8c767b1..72356d0e 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart'; +import 'package:diplomaticquarterapp/pages/Blood/blood_donation_appointment_terms_conditions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; @@ -532,23 +533,18 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { case 30: return "assets/images/new-design/NFCIcon_option2.png"; break; - case 40: return "assets/images/new-design/video_call_instruction.png"; break; - case 50: return "assets/images/new-design/confirm_button.png"; break; - case 60: return "assets/images/new-design/waiting_for_doctor.png"; break; - case 90: return "assets/images/new-design/NFCIcon_option2.png"; break; - default: return ""; } @@ -572,6 +568,10 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { case 30: getAppoQR(context, appo); break; + case 40: + openInstructions(appo); + break; + case 50: confirmAppointment(appo); break; @@ -583,6 +583,12 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } } + openInstructions(AppoitmentAllHistoryResultList appo) { + if (appo.clinicID == 134) { + Navigator.of(context).push(FadePage(page: BloodDonationAppointmentTermsConditions())); + } + } + Color getNextActionButtonColor(nextAction) { switch (nextAction) { case 0: diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 3ab3fa66..61009cb4 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2917,6 +2917,7 @@ class TranslationBase { String get noUpcomingAppointment => localizedValues["noUpcomingAppointment"][locale.languageCode]; String get locationTimeoutError => localizedValues["locationTimeoutError"][locale.languageCode]; String get loadMore => localizedValues["loadMore"][locale.languageCode]; + String get selectHospitalBloodDonation => localizedValues["selectHospitalBloodDonation"][locale.languageCode]; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 1ed0f663..71aee90f 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -40,9 +40,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 diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index d302ea2d..1df9acc9 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -26,14 +26,14 @@ class DoctorHeader extends StatelessWidget { DoctorHeader( {Key key, - @required this.headerModel, - @required this.buttonTitle, - @required this.onTap, - this.isNeedToShowButton = true, - this.isShowName = false, - this.buttonIcon, - this.showConfirmMessageDialog = true, - @required this.onRatingAndReviewTap}) + @required this.headerModel, + @required this.buttonTitle, + @required this.onTap, + this.isNeedToShowButton = true, + this.isShowName = false, + this.buttonIcon, + this.showConfirmMessageDialog = true, + @required this.onRatingAndReviewTap}) : super(key: key); ProjectViewModel projectViewModel; @@ -76,9 +76,9 @@ class DoctorHeader extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (_speciality.isNotEmpty) + if (_speciality != null && _speciality.isNotEmpty) Text( - _speciality, + _speciality != "null" ? _speciality : "", style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), ), headerModel.invoiceNo.isNotEmpty ? MyRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo, projectViewModel.isArabic) : Container(), @@ -154,29 +154,29 @@ class DoctorHeader extends StatelessWidget { ), isNeedToShowButton ? InkWell( - onTap: () { - if (showConfirmMessageDialog) - showConfirmMessage(context, onTap, headerModel.email); - else - onTap(); - }, - child: Container( - padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), - decoration: BoxDecoration( - color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0), - SizedBox(width: 6), - Text( - buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 1), + onTap: () { + if (showConfirmMessageDialog) + showConfirmMessage(context, onTap, headerModel.email); + else + onTap(); + }, + child: Container( + padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), + decoration: BoxDecoration( + color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0), + SizedBox(width: 6), + Text( + buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 1), + ), + ], + ), ), - ], - ), - ), - ) + ) : Container(), ], ), @@ -303,8 +303,7 @@ class DoctorHeader extends StatelessWidget { ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text(getRatingWidth(doctorDetailsList[0].ratio).round().toString() + "%", - style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(getRatingWidth(doctorDetailsList[0].ratio).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), @@ -324,8 +323,7 @@ class DoctorHeader extends StatelessWidget { ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text(doctorDetailsList[1].ratio.round().toString() + "%", - style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(doctorDetailsList[1].ratio.round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), @@ -345,8 +343,7 @@ class DoctorHeader extends StatelessWidget { ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text(doctorDetailsList[2].ratio.round().toString() + "%", - style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(doctorDetailsList[2].ratio.round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), @@ -366,8 +363,7 @@ class DoctorHeader extends StatelessWidget { ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text(doctorDetailsList[3].ratio.round().toString() + "%", - style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(doctorDetailsList[3].ratio.round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ), @@ -388,8 +384,7 @@ class DoctorHeader extends StatelessWidget { ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text(doctorDetailsList[4].ratio.round().toString() + "%", - style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text(doctorDetailsList[4].ratio.round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), ], ),