Merge branch 'development_new_design_2.0' into zik_new_design_2.0

* development_new_design_2.0: (33 commits)
  base app client changes
  Translation & UI updates
  FAMILY FILE
  family files
  localisation update
  family file change
  E-Refreal design
  blood pressure, blood sugar, weight, order log & send feedback dialog changes and improvements (cont).
  Updates & fixes
  all dialog changes and improvements (cont).
  UI fixes & updates
  family files changes
  Notification page fix
  Notifications UI fix
  feedback status added.
  Notifications UI redesigned
  Blood pressure chart fix
  My tracker fixes
  my family
  fixes
  ...
merge-requests/437/head
Zohaib Iqbal Kambrani 5 years ago
commit 57a3c2a04c

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 17 17">
<g id="Group_8364" data-name="Group 8364" transform="translate(-238 -335)">
<circle id="Ellipse_4" data-name="Ellipse 4" cx="8.5" cy="8.5" r="8.5" transform="translate(238 335)" fill="#349745"/>
<text id="Check" transform="translate(242 347)" fill="#fff" font-size="9" font-family="FontAwesome5Free-Solid, 'Font Awesome \35 Free'" letter-spacing="-0.06em"><tspan x="0" y="0"></tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 503 B

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="14.068" height="14.94" viewBox="0 0 14.068 14.94">
<g id="Group_8471" data-name="Group 8471" transform="translate(-325.503 -184.253)">
<path id="Path_5005" data-name="Path 5005" d="M9.7,3.407h2.814a.7.7,0,0,0,0-1.407H9.7a.7.7,0,0,0,0,1.407Z" transform="translate(321.427 182.253)" fill="#5a282e"/>
<path id="Path_5004" data-name="Path 5004" d="M15.365,5H2.7a.7.7,0,1,0,0,1.407H4.11v8.441a2.111,2.111,0,0,0,2.11,2.11h5.627a2.111,2.111,0,0,0,2.11-2.11V6.407h1.407a.7.7,0,1,0,0-1.407ZM8.331,12.738a.7.7,0,1,1-1.407,0V9.221a.7.7,0,1,1,1.407,0Zm2.814,0a.7.7,0,1,1-1.407,0V9.221a.7.7,0,1,1,1.407,0Z" transform="translate(323.503 182.235)" fill="#5a282e"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 721 B

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 17 17">
<g id="Group_8365" data-name="Group 8365" transform="translate(-238 -335)">
<circle id="Ellipse_4" data-name="Ellipse 4" cx="8.5" cy="8.5" r="8.5" transform="translate(238 335)" fill="#d02127"/>
<path id="close_3_" data-name="close (3)" d="M4.449,3.9,7.377.967A.487.487,0,0,0,6.688.279L3.76,3.207.832.279A.487.487,0,0,0,.143.967L3.071,3.9.143,6.824a.487.487,0,1,0,.689.689L3.76,4.584,6.688,7.512a.487.487,0,0,0,.689-.689Zm0,0" transform="translate(242.74 339.604)" fill="#fff" stroke="#fff" stroke-width="0.75"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 621 B

@ -0,0 +1,10 @@
<svg id="switch" xmlns="http://www.w3.org/2000/svg" width="15.172" height="15.172" viewBox="0 0 15.172 15.172">
<path id="Path_5147" data-name="Path 5147" d="M16.48,8.057a.474.474,0,0,1-.474-.474V4.738a.791.791,0,0,0-.79-.79H10.474a.474.474,0,1,1,0-.948h4.741a1.74,1.74,0,0,1,1.738,1.738V7.583A.474.474,0,0,1,16.48,8.057Z" transform="translate(-3.678 -1.104)" fill="#5a282e"/>
<path id="Path_5148" data-name="Path 5148" d="M19.33,9.8A.47.47,0,0,1,19,9.665L17.889,8.559a.474.474,0,0,1,.335-.809h2.213a.474.474,0,0,1,.335.809L19.666,9.665A.47.47,0,0,1,19.33,9.8Z" transform="translate(-6.529 -2.851)" fill="#5a282e"/>
<path id="Path_5149" data-name="Path 5149" d="M8.215,18.057H4.738A1.74,1.74,0,0,1,3,16.319V13.474a.474.474,0,1,1,.948,0v2.845a.791.791,0,0,0,.79.79H8.215a.474.474,0,1,1,0,.948Z" transform="translate(-1.104 -4.782)" fill="#5a282e"/>
<path id="Path_5150" data-name="Path 5150" d="M3.937,15.055H1.724a.474.474,0,0,1-.335-.809L2.5,13.139a.474.474,0,0,1,.671,0l1.106,1.106a.474.474,0,0,1-.336.809Z" transform="translate(-0.46 -4.782)" fill="#5a282e"/>
<circle id="Ellipse_186" data-name="Ellipse 186" cx="1.58" cy="1.58" r="1.58" transform="translate(1.58)" fill="#5a282e"/>
<path id="Path_5151" data-name="Path 5151" d="M4.583,6H1.738A1.74,1.74,0,0,0,0,7.738v.316a.474.474,0,0,0,.474.474H5.847a.474.474,0,0,0,.474-.474V7.738A1.74,1.74,0,0,0,4.583,6Z" transform="translate(0 -2.207)" fill="#5a282e"/>
<path id="Path_5152" data-name="Path 5152" d="M18.08,17.161a1.58,1.58,0,1,1,1.58-1.58A1.583,1.583,0,0,1,18.08,17.161Z" transform="translate(-6.069 -5.15)" fill="#5a282e"/>
<path id="Path_5153" data-name="Path 5153" d="M19.847,22.529H14.474A.474.474,0,0,1,14,22.055v-.316A1.74,1.74,0,0,1,15.738,20h2.845a1.74,1.74,0,0,1,1.738,1.738v.316A.474.474,0,0,1,19.847,22.529Z" transform="translate(-5.15 -7.357)" fill="#5a282e"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

@ -438,6 +438,10 @@ const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
// CMC RC SERVICES
const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc';
const ADD_CMC_ORDER_RC = 'rc/api/cmc/add';
//Pharmacy wishlist //Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/"; const GET_WISHLIST = "shopping_cart_items/";
const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id="; const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id=";

@ -92,7 +92,7 @@ const Map localizedValues = {
'changePayment': {'en': 'Change Payment Method', 'ar': 'تغيير آلية الدفع'}, 'changePayment': {'en': 'Change Payment Method', 'ar': 'تغيير آلية الدفع'},
'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يلزم اتخاذ أي إجراء'}, 'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يلزم اتخاذ أي إجراء'},
'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'}, 'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'},
"book-success-confirm-more-24-1-2": {"en": "The online payment process will be available 24 hours before the appointment.", "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة."}, "book-success-confirm-more-24-1-2": {"en": "The online payment process will be available 24 hours before the appointment.", "ar": "عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة."},
'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'}, 'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'},
'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي طابور الانتظار'}, 'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي طابور الانتظار'},
'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور بشكل آلي في المستشفى'}, 'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور بشكل آلي في المستشفى'},
@ -231,7 +231,7 @@ const Map localizedValues = {
"unit": {"en": "Unit", "ar": "وحدة"}, "unit": {"en": "Unit", "ar": "وحدة"},
"request": {"en": "Request", "ar": "طلبات الاضافة"}, "request": {"en": "Request", "ar": "طلبات الاضافة"},
"member-name": {"en": "Member Name", "ar": "اسم العضو"}, "member-name": {"en": "Member Name", "ar": "اسم العضو"},
"switch-login": {"en": "Switch User", "ar": "تغير المستخدم"}, "switch-login": {"en": "Switch", "ar": "تغير "},
"remove-member": {"en": "Remove", "ar": "حذف"}, "remove-member": {"en": "Remove", "ar": "حذف"},
"allow-view": {"en": "Allow", "ar": "قبول"}, "allow-view": {"en": "Allow", "ar": "قبول"},
"reject-view": {"en": "Reject", "ar": "رفض"}, "reject-view": {"en": "Reject", "ar": "رفض"},
@ -258,7 +258,7 @@ const Map localizedValues = {
"requestType": {"en": "Request Type", "ar": "نوع الاستفسار"}, "requestType": {"en": "Request Type", "ar": "نوع الاستفسار"},
"register-info-family": {"en": "How would like to add the new member?", "ar": "كيف ترغب باضافة العضو الجديد؟"}, "register-info-family": {"en": "How would like to add the new member?", "ar": "كيف ترغب باضافة العضو الجديد؟"},
"remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"}, "remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"},
"MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'}, "MyMedicalFile": {"en": "My Medical File", 'ar': 'الملف الطبي الالكتروني'},
"myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'}, "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'},
"viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, "viewMore": {"en": "View More", 'ar': 'عرض المزيد'},
"homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'}, "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'},
@ -316,7 +316,7 @@ const Map localizedValues = {
"NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"},
"NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"},
"noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم يتم حضورها"}, "noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم يتم حضورها"},
"MyAppointmentsList": {"en": "Appointments", "ar": "قائمة بمواعدي"}, "MyAppointmentsList": {"en": "Appointments", "ar": "قائمة بمواعيدي"},
"Radiology": {"en": "Radiology", "ar": "الأشعة"}, "Radiology": {"en": "Radiology", "ar": "الأشعة"},
"RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"}, "RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"},
"Lab": {"en": "Lab", "ar": "تحليل المختبر"}, "Lab": {"en": "Lab", "ar": "تحليل المختبر"},
@ -331,7 +331,7 @@ const Map localizedValues = {
"MyDoctorSubtitle": {"en": "List", "ar": "قمت بزيارتهم"}, "MyDoctorSubtitle": {"en": "List", "ar": "قمت بزيارتهم"},
"Eye": {"en": "Eye", "ar": "قياسات"}, "Eye": {"en": "Eye", "ar": "قياسات"},
"EyeSubtitle": {"en": "Measurement", "ar": "النظر"}, "EyeSubtitle": {"en": "Measurement", "ar": "النظر"},
"Insurance": {"en": "Insurance", "ar": "بطاقة"}, "Insurance": {"en": "Insurance", "ar": "بطاقات"},
"InsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, "InsuranceSubtitle": {"en": "Card", "ar": "التأمين"},
"UpdateInsurance": {"en": "Update Insurance", "ar": "تحديث التأمين"}, "UpdateInsurance": {"en": "Update Insurance", "ar": "تحديث التأمين"},
"UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, "UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"},
@ -399,7 +399,7 @@ const Map localizedValues = {
"AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"},
"AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for your account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"}, "AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for your account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"},
"FileNumber": {"en": "File Number", "ar": "رقم الملف"}, "FileNumber": {"en": "File Number", "ar": "رقم الملف"},
"Amount": {"en": "Amount *", "ar": "المبلغ *"}, "Amount": {"en": "Amount *", "ar": "الكمية *"},
"DepositorEmail": {"en": "Depositor Email *", "ar": "البريد الإلكتروني للمودع *"}, "DepositorEmail": {"en": "Depositor Email *", "ar": "البريد الإلكتروني للمودع *"},
"Notes": {"en": "Notes", "ar": "ملاحظات"}, "Notes": {"en": "Notes", "ar": "ملاحظات"},
"SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"}, "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"},
@ -511,9 +511,9 @@ const Map localizedValues = {
"medicalFile": {"en": "Medical File", "ar": "ملف طبي"}, "medicalFile": {"en": "Medical File", "ar": "ملف طبي"},
"verified": {"en": "Verified", "ar": "تم التحقق"}, "verified": {"en": "Verified", "ar": "تم التحقق"},
"checkup": {"en": "Checkup", "ar": "فحص"}, "checkup": {"en": "Checkup", "ar": "فحص"},
"hhcHome": {"en": "HHC Home", "ar": "الصفحة الرئيسية HHC"}, "hhcHome": {"en": "Home", "ar": "الرعاية"},
"refferal": {"en": "E-Refferal", "ar": "الإحالة الإلكترونية"}, "refferal": {"en": "E-Refferal", "ar": "الإحالة الإلكترونية"},
"healthCare": {"en": "Health Care", "ar": "الرعاية الصحية"}, "healthCare": {"en": "Health Care", "ar": "الصحية المزلية"},
"emergency": {"en": "Emergency", "ar": "طارئ"}, "emergency": {"en": "Emergency", "ar": "طارئ"},
"cantSeeProfile": {"en": "Cant see your medical File?", "ar": "لا تستطيع رؤية ملفك الطبي؟"}, "cantSeeProfile": {"en": "Cant see your medical File?", "ar": "لا تستطيع رؤية ملفك الطبي؟"},
"loginRegisterNow": {"en": "Login or Register Now", "ar": "تسجيل الدخول أو التسجيل الآن"}, "loginRegisterNow": {"en": "Login or Register Now", "ar": "تسجيل الدخول أو التسجيل الآن"},
@ -521,7 +521,7 @@ const Map localizedValues = {
"ecommerceSolution": {"en": "Ecommerce Solution", "ar": "حل التجارة الإلكترونية"}, "ecommerceSolution": {"en": "Ecommerce Solution", "ar": "حل التجارة الإلكترونية"},
"services2": {"en": "Services", "ar": "خدمات"}, "services2": {"en": "Services", "ar": "خدمات"},
"comprehensive": {"en": "Comprehensive", "ar": "شامل"}, "comprehensive": {"en": "Comprehensive", "ar": "شامل"},
"onlineConsulting": {"en": "Online Consulting", "ar": "استشارات عبر الإنترنت"}, "onlineConsulting": {"en": "Online Consulting", "ar": "استشارات فورية"},
"pendingOrder": {"en": " PENDING", "ar": " معلقة"}, "pendingOrder": {"en": " PENDING", "ar": " معلقة"},
"deliveredOrder": {"en": " DELIVERED", "ar": "تم التوصيل"}, "deliveredOrder": {"en": " DELIVERED", "ar": "تم التوصيل"},
"processingOrder": {"en": " PROCESSING", "ar": "قيد التنفيذ"}, "processingOrder": {"en": " PROCESSING", "ar": "قيد التنفيذ"},
@ -606,6 +606,7 @@ const Map localizedValues = {
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"select": {"en": "Select", "ar": "يختار"},
"i-am": {"en": "I am", "ar": "أنا"}, "i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
@ -894,7 +895,7 @@ const Map localizedValues = {
"somethingWentWrongTryLater": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر عن خدمتك يرجى المحاولة لاحقا"}, "somethingWentWrongTryLater": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر عن خدمتك يرجى المحاولة لاحقا"},
"TotalAmountPayable": {"en": "Total Amount Payable:", "ar": " إجمالي المبلغ المستحق:"}, "TotalAmountPayable": {"en": "Total Amount Payable:", "ar": " إجمالي المبلغ المستحق:"},
"iAcceptTermsConditions": {"en": "I Accept the Terms and Conditions", "ar": "أوافق على الشروط والأحكام"}, "iAcceptTermsConditions": {"en": "I Accept the Terms and Conditions", "ar": "أوافق على الشروط والأحكام"},
"YouCanPayByTheFollowingOptions": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"}, "YouCanPayByTheFollowingOptions": {"en": "You can pay by the following options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"},
"RRTDDetails": { "RRTDDetails": {
"en": "en":
"The RRT service provides medical service for urgent and stable cases, not life-threatening situations or extremities, and the service includes providing medical care from a complete medical team at home.", "The RRT service provides medical service for urgent and stable cases, not life-threatening situations or extremities, and the service includes providing medical care from a complete medical team at home.",
@ -1070,8 +1071,8 @@ const Map localizedValues = {
"added-child": {"en": "The request was successful. You have added a child to the vaccination schedule subscription service.", "ar": "تمت الاضافة بنجاح."}, "added-child": {"en": "The request was successful. You have added a child to the vaccination schedule subscription service.", "ar": "تمت الاضافة بنجاح."},
"appUpdate": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"}, "appUpdate": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"},
"ereferralSaveSuccess": { "ereferralSaveSuccess": {
"en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process. Referral request no is ", "en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process.",
"ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية. رقم طلب الإحالة" "ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية."
}, },
"help": {"en": "Help", "ar": "مساعدة"}, "help": {"en": "Help", "ar": "مساعدة"},
"habibRobotText": { "habibRobotText": {
@ -1146,7 +1147,7 @@ const Map localizedValues = {
"other": {"en": "Other", "ar": "آخر"}, "other": {"en": "Other", "ar": "آخر"},
"measure-unit": {"en": "Measure unit", "ar": "وحدة القياس"}, "measure-unit": {"en": "Measure unit", "ar": "وحدة القياس"},
"measure-time": {"en": "Measure time", "ar": "وقت القياس"}, "measure-time": {"en": "Measure time", "ar": "وقت القياس"},
"update": {"en": "Update", "ar": "تعديل"}, "update": {"en": "Update", "ar": "تحديث"},
"bloodD-enter-desc": {"en": "Enter the required information, in order to register for Blood Donation Service", "ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم"}, "bloodD-enter-desc": {"en": "Enter the required information, in order to register for Blood Donation Service", "ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم"},
"viewTermsConditions": {"en": "To view the terms and conditions", "ar": "لعرض الشروط والأحكام"}, "viewTermsConditions": {"en": "To view the terms and conditions", "ar": "لعرض الشروط والأحكام"},
"WalkinAppo": {"en": "Hospital Visit Appointment", "ar": "موعد زيارة للمستشفى"}, "WalkinAppo": {"en": "Hospital Visit Appointment", "ar": "موعد زيارة للمستشفى"},
@ -1236,7 +1237,7 @@ const Map localizedValues = {
"undo": {"en": "Undo", "ar": "تراجع"}, "undo": {"en": "Undo", "ar": "تراجع"},
"drinking": {"en": "Drinkning", "ar": "الشرب"}, "drinking": {"en": "Drinkning", "ar": "الشرب"},
"remaining": {"en": "Remaining", "ar": "المتبقي"}, "remaining": {"en": "Remaining", "ar": "المتبقي"},
"addCustomAmount": {"en": "Add Custom Amount", "ar": "إضافة مبلغ مخصص"}, "addCustomAmount": {"en": "Add Custom Amount", "ar": "إضافة كمية محددة"},
"left": {"en": "Left", "ar": "المتبقي"}, "left": {"en": "Left", "ar": "المتبقي"},
"taken": {"en": "Taken", "ar": " مأخوذ"}, "taken": {"en": "Taken", "ar": " مأخوذ"},
"ml": {"en": "ML", "ar": "مل"}, "ml": {"en": "ML", "ar": "مل"},
@ -1298,7 +1299,9 @@ const Map localizedValues = {
"try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'},
"app-update": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"}, "app-update": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"},
"covid-alert": {"en": "Alert", "ar": "تنبيه"}, "covid-alert": {"en": "Alert", "ar": "تنبيه"},
"enterIdentificationNumber": {"en": "Enter Identification Number", "ar": "أدخل رقم التعريف"}, "enterIdentificationNumber": {"en": "Enter Identification Number", "ar": "أدخل رقم الهوية"},
"identificationNumber": {"en": "Identification Number", "ar": "رقم الهوية"},
"complaintNumber": {"en": "Complaint Number", "ar": "رقم الشكوى"},
"accountActivationDesc": { "accountActivationDesc": {
"en": " This service allows you to activate your LAKUM account after registering completed.", "en": " This service allows you to activate your LAKUM account after registering completed.",
"ar": " تتيح لك هذه الخدمة تفعيل حساب برنامج الولاء لكم بعد اكتمال التسجيل. " "ar": " تتيح لك هذه الخدمة تفعيل حساب برنامج الولاء لكم بعد اكتمال التسجيل. "
@ -1489,12 +1492,34 @@ const Map localizedValues = {
"medicalReport": {"en": "Medical Report", "ar": "تقرير طبي"}, "medicalReport": {"en": "Medical Report", "ar": "تقرير طبي"},
"insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"}, "insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"},
"rateDoctor": {"en": "Rate Doctor", "ar": "تقييم الطبيب"}, "rateDoctor": {"en": "Rate Doctor", "ar": "تقييم الطبيب"},
"rateAppointment": {"en": "Rate Appointment", "ar": "سعر التعيين"}, "rateAppointment": {"en": "Rate Appointment", "ar": "تقييم الموعد"},
"noInsuranceCardAttached": {"en": "Please attach your insurance card image to continue", "ar": "يرجى إرفاق صورة بطاقة التأمين الخاصة بك للمتابعة"}, "noInsuranceCardAttached": {"en": "Please attach your insurance card image to continue", "ar": "يرجى إرفاق صورة بطاقة التأمين الخاصة بك للمتابعة"},
"bodyMassIndex": {"en": "Body Mass Index is: ", "ar": "مؤشر كتلة الجسم هو:"}, "bodyMassIndex": {"en": "Body Mass Index is: ", "ar": "مؤشر كتلة الجسم هو:"},
"noSlotsError": {"en": "No appointments available for selected date", "ar": "لا توجد مواعيد متاحة للتاريخ المحدد"}, "noSlotsError": {"en": "No appointments available for selected date", "ar": "لا توجد مواعيد متاحة للتاريخ المحدد"},
"selectSlot": {"en": "Please select Time Slot to continue", "ar": "الرجاء تحديد فترة زمنية للمتابعة"}, "selectSlot": {"en": "Please select Time Slot to continue", "ar": "الرجاء تحديد فترة زمنية للمتابعة"},
"years": {"en": "Years", "ar": "سنوات"}, "years": {"en": "Years", "ar": "سنوات"},
"respirationBPM": { "en": "bpm", "ar": "نفس" }, "respirationBPM": {"en": "bpm", "ar": "نفس"},
"extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"},
"invoiceDetails": {"en": "Invoice Details", "ar": "تفاصيل الفاتورة"},
"appoDetails": {"en": "Appointment Details", "ar": "تفاصيل الموعد"},
"appoPaymentConfirm": {"en": "Are you sure you Want to make payment for this appointment?", "ar": "هل أنت متأكد من أنك تريد سداد هذا الموعد؟"},
"selectSearchCriteria": {"en": "Select the search criteria", "ar": "حدد معايير البحث"},
"enterComplainNumber": {"en": "Enter the Complain Number", "ar": "أدخل رقم الشكوى"},
"enterfileNumber": {"en": "Enter File Number", "ar": "أدخل رقم الملف"},
"please_select_from_below_options": {"en": "Please select from below options:", "ar": "الرجاء التحديد من الخيارات أدناه:"},
"selectLanguage": {"en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة"},
"recAlert": {"en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟"},
"modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"},
"prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"},
"permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"},
"appointmentReminder": { "en": "Would you like to set a reminder for this appointment in your calendar?", "ar": "هل ترغب في اضافة تذكير لهذا الموعد في التقويم؟" },
"cancelAppointment": { "en": "Cancel Appt.", "ar": "الغاء الموعد" },
"updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"},
"patientAge": {"en": "y", "ar": "سنة"},
"searchCriteria": { "en": "Select Search Criteria", "ar": "حدد معايير البحث" },
"RequesterInfo": {"en": "Requester Info", "ar": "معلومات مقدم الطلب"},
"PatientInfo": {"en": "Patient Info", "ar": "معلومات المريض"},
"OtherInfo": {"en": "Other Info", "ar": "معلومات اخرى"},
"inPrgress": {"en": "In Progress", "ar": "في تقدم"},
"locked": {"en": "Locked", "ar": "مقفل"},
}; };

@ -73,20 +73,21 @@ class CMCInsertPresOrderRequestModel {
data['LanguageID'] = this.languageID; data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA; data['patientOutSa'] = this.patientOutSA;
data['isOutPatient'] = this.patientOutSA == 0 ? false : true;
data['SessionID'] = this.sessionID; data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID; data['DeviceTypeID'] = this.deviceTypeID;
data['PatientID'] = this.patientID; data['patientId'] = this.patientID.toString();
data['TokenID'] = this.tokenID; data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID; data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType; data['PatientType'] = this.patientType;
data['Latitude'] = this.latitude; data['latitude'] = this.latitude;
data['Longitude'] = this.longitude; data['longitude'] = this.longitude;
data['CreatedBy'] = this.createdBy; // data['CreatedBy'] = this.createdBy;
data['OrderServiceID'] = this.orderServiceID; data['OrderServiceID'] = this.orderServiceID;
if (this.patientERCMCInsertServicesList != null) { if (this.patientERCMCInsertServicesList != null) {
data['PatientER_CMC_InsertServicesList'] = data['procedures'] =
this.patientERCMCInsertServicesList.map((v) => v.toJson()).toList(); this.patientERCMCInsertServicesList.map((v) => v.toJson()).toList();
} }
return data; return data;

@ -1,44 +1,56 @@
class GetCMCServicesResponseModel { class GetCMCServicesResponseModel {
String description; int id;
String descriptionN; String serviceID;
int iD; int orderServiceID;
bool isActive; String text;
String textN;
dynamic price; dynamic price;
int serviceID; dynamic priceVAT;
dynamic totalPrice; dynamic priceTotal;
dynamic vAT; bool isEnabled;
int orderId;
int quantity;
GetCMCServicesResponseModel( GetCMCServicesResponseModel(
{this.description, {this.id,
this.descriptionN,
this.iD,
this.isActive,
this.price,
this.serviceID, this.serviceID,
this.totalPrice, this.orderServiceID,
this.vAT}); this.text,
this.textN,
this.price,
this.priceVAT,
this.priceTotal,
this.isEnabled,
this.orderId,
this.quantity});
GetCMCServicesResponseModel.fromJson(Map<String, dynamic> json) { GetCMCServicesResponseModel.fromJson(Map<String, dynamic> json) {
description = json['Description']; id = json['id'];
descriptionN = json['DescriptionN']; serviceID = json['serviceID'];
iD = json['ID']; orderServiceID = json['orderServiceID'];
isActive = json['IsActive']; text = json['text'];
price = json['Price']; textN = json['textN'];
serviceID = json['ServiceID']; price = json['price'];
totalPrice = json['TotalPrice']; priceVAT = json['priceVAT'];
vAT = json['VAT']; priceTotal = json['priceTotal'];
isEnabled = json['isEnabled'];
orderId = json['orderId'];
quantity = json['quantity'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description; data['id'] = this.id;
data['DescriptionN'] = this.descriptionN; data['serviceID'] = this.serviceID;
data['ID'] = this.iD; data['orderServiceID'] = this.orderServiceID;
data['IsActive'] = this.isActive; data['text'] = this.text;
data['Price'] = this.price; data['textN'] = this.textN;
data['ServiceID'] = this.serviceID; data['price'] = this.price;
data['TotalPrice'] = this.totalPrice; data['priceVAT'] = this.priceVAT;
data['VAT'] = this.vAT; data['priceTotal'] = this.priceTotal;
data['isEnabled'] = this.isEnabled;
data['orderId'] = this.orderId;
data['quantity'] = this.quantity;
return data; return data;
} }
} }

@ -23,17 +23,30 @@ class CMCService extends BaseService {
bool isOrderUpdated; bool isOrderUpdated;
Future getCMCAllServices() async { Future getCMCAllServices() async {
GetCMCServicesRequestModel getCMCServicesRequestModel = new GetCMCServicesRequestModel(genderID: authenticatedUserObject.user.gender, identificationNo: authenticatedUserObject.user.patientIdentificationNo); GetCMCServicesRequestModel getCMCServicesRequestModel =
new GetCMCServicesRequestModel(genderID: authenticatedUserObject.user.gender, identificationNo: authenticatedUserObject.user.patientIdentificationNo);
hasError = false; hasError = false;
await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, onSuccess: (dynamic response, int statusCode) {
// RC IMPLEMENTATION
await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isAllowAny: true, onSuccess: (dynamic response, int statusCode) {
cmcAllServicesList.clear(); cmcAllServicesList.clear();
response['PatientER_CMC_GetAllServicesList'].forEach((data) { response.forEach((data) {
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: getCMCServicesRequestModel.toJson()); }, body: {});
// await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, onSuccess: (dynamic response, int statusCode) {
// cmcAllServicesList.clear();
// response['PatientER_CMC_GetAllServicesList'].forEach((data) {
// cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: getCMCServicesRequestModel.toJson());
} }
Future getCmcAllPresOrders() async { Future getCmcAllPresOrders() async {
@ -87,12 +100,25 @@ class CMCService extends BaseService {
}, body: updatePresOrderRequestModel.toJson()); }, body: updatePresOrderRequestModel.toJson());
} }
Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async {
hasError = false;
String reqId = "";
await baseAppClient.post(ADD_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true;
reqId = response['RequestNo'].toString();
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: order.toJson());
return reqId;
}
Future<String> insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { Future<String> insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
hasError = false; hasError = false;
String reqId=""; String reqId = "";
await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
reqId=response['RequestNo'].toString(); reqId = response['RequestNo'].toString();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -116,6 +116,7 @@ class EReferralService extends BaseService {
SearchEReferralRequestModel searchEReferralRequestModel) async { SearchEReferralRequestModel searchEReferralRequestModel) async {
_allReferral.clear(); _allReferral.clear();
hasError = false; hasError = false;
// TODO return this code when the fix the server // TODO return this code when the fix the server
await baseAppClient.post(GET_E_REFERRALS, await baseAppClient.post(GET_E_REFERRALS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -113,6 +113,19 @@ class BaseAppClient {
} }
} }
// For RC Services
// if(body.containsKey("patientId"))
// body.remove("PatientID");
//
// if(body.containsKey("patientOutSa"))
// body.remove("PatientOutSA");
//
// body['PatientID'] = 1018977;
// body['TokenID'] = "@dm!n";
// body['IdentificationNo'] = "1009199553";
// body['MobileNo'] = "966545156035";
// body['PatientMobileNumber'] = "966545156035";
print("URL : $url"); print("URL : $url");
final jsonBody = json.encode(body); final jsonBody = json.encode(body);
print(jsonBody); print(jsonBody);
@ -126,60 +139,65 @@ class BaseAppClient {
} else { } else {
var decoded = utf8.decode(response.bodyBytes); var decoded = utf8.decode(response.bodyBytes);
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) {
if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['Response_Message'] != null) {
navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
}
if (parsed['ErrorType'] == 2) {
await logout();
}
if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['IsAuthenticated'] == null) { } else {
if (parsed['isSMSSent'] == true) { if (parsed['ErrorType'] == 4) {
onSuccess(parsed, statusCode); navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
} else if (parsed['MessageStatus'] == 1) { }
onSuccess(parsed, statusCode); if (parsed['ErrorType'] == 2) {
} else if (parsed['Result'] == 'OK') { await logout();
}
if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else if (parsed['IsAuthenticated'] == null) {
if (parsed != null) { if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); if (parsed != null) {
logout(); onSuccess(parsed, statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logout();
}
} }
} } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['SameClinicApptList'] != null) {
if (parsed['ErrorSearchMsg'] == null) { onSuccess(parsed, statusCode);
onFailure("Server Error found with no available message", statusCode); } else {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", statusCode);
} else {
onFailure(parsed['ErrorSearchMsg'], statusCode);
}
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
} }
} else {
onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
} }
} }
} // else if (!parsed['IsAuthenticated']) {
// else if (!parsed['IsAuthenticated']) { // await logout();
// await logout(); // }
// } else {
else { if (parsed['SameClinicApptList'] != null) {
if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode);
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
} }
} }
} }

@ -13,37 +13,28 @@ class FeedbackService extends BaseService {
RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem(); RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem();
List<AppoitmentAllHistoryResultList> appointHistoryList = List(); List<AppoitmentAllHistoryResultList> appointHistoryList = List();
Future sendCOCItem( Future sendCOCItem({String title, String details, String cOCTypeName, String attachment, AppoitmentAllHistoryResultList appointHistory}) async {
{String title,
String details,
String cOCTypeName,
String attachment,
AppoitmentAllHistoryResultList appointHistory}) async {
hasError = false; hasError = false;
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_requestInsertCOCItem.attachment = attachment; _requestInsertCOCItem.attachment = attachment;
_requestInsertCOCItem.title = title; _requestInsertCOCItem.title = title;
_requestInsertCOCItem.details = details; _requestInsertCOCItem.details = details;
_requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.cOCTypeName = cOCTypeName;
_requestInsertCOCItem.formTypeID = cOCTypeName; _requestInsertCOCItem.formTypeID = cOCTypeName;
_requestInsertCOCItem.mobileNo = _requestInsertCOCItem.mobileNo = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
"966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
_requestInsertCOCItem.isUserLoggedIn = true; _requestInsertCOCItem.isUserLoggedIn = true;
_requestInsertCOCItem.projectID = user.projectID; _requestInsertCOCItem.projectID = user.projectID;
_requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName;
_requestInsertCOCItem.fileName = ""; _requestInsertCOCItem.fileName = "";
_requestInsertCOCItem.appVersion = VERSION_ID; _requestInsertCOCItem.appVersion = VERSION_ID;
_requestInsertCOCItem.uILanguage = _requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic
languageID; //TODO Change it to be dynamic
_requestInsertCOCItem.browserInfo = Platform.localHostname; _requestInsertCOCItem.browserInfo = Platform.localHostname;
_requestInsertCOCItem.deviceInfo = Platform.localHostname; _requestInsertCOCItem.deviceInfo = Platform.localHostname;
_requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.resolution = "400x847";
_requestInsertCOCItem.projectID = 0; _requestInsertCOCItem.projectID = 0;
_requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948"; _requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948";
_requestInsertCOCItem.identificationNo = _requestInsertCOCItem.identificationNo = int.parse(user.patientIdentificationNo);
int.parse(user.patientIdentificationNo);
if (BASE_URL.contains('uat')) { if (BASE_URL.contains('uat')) {
_requestInsertCOCItem.forDemo = true; _requestInsertCOCItem.forDemo = true;
} else { } else {
@ -61,9 +52,7 @@ class FeedbackService extends BaseService {
body['ProjectName'] = appointHistory.projectName; body['ProjectName'] = appointHistory.projectName;
} }
await baseAppClient await baseAppClient.post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
.post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
@ -73,15 +62,34 @@ class FeedbackService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
body['MobileNo'] = body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
"966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); body['Searching_type'] = 1;
body['Searching_type'] = '1';
if (BASE_URL.contains('uat')) { if (BASE_URL.contains('uat')) {
body['ForDemo'] = true; body['ForDemo'] = true;
} }
await baseAppClient.post(GET_STATUS_FOR_COCO, await baseAppClient.post(GET_STATUS_FOR_COCO, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { cOCItemList = [];
response['ListCOCItems'].forEach((cOC) {
cOCItemList.add(COCItem.fromJson(cOC));
});
cOCItemList = cOCItemList.reversed.toList(); // Sort list in desc order
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future searchFeedback(String countryCode, String phoneNumber, int type, String idNumber) async {
hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>();
body['IdentificationNo'] = idNumber;
body['MobileNo'] = countryCode + Utils.getPhoneNumberWithoutZero(phoneNumber);
body['Searching_type'] = "$type";
if (BASE_URL.contains('uat')) {
body['ForDemo'] = true;
}
await baseAppClient.post(GET_STATUS_FOR_COCO, onSuccess: (dynamic response, int statusCode) {
cOCItemList = []; cOCItemList = [];
response['ListCOCItems'].forEach((cOC) { response['ListCOCItems'].forEach((cOC) {
cOCItemList.add(COCItem.fromJson(cOC)); cOCItemList.add(COCItem.fromJson(cOC));
@ -97,12 +105,10 @@ class FeedbackService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();
body['IsComingFromCOC'] = true; body['IsComingFromCOC'] = true;
baseAppClient.post(GET_PATIENT_AppointmentHistory, baseAppClient.post(GET_PATIENT_AppointmentHistory, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
appointHistoryList = []; appointHistoryList = [];
response['AppoimentAllHistoryResultList'].forEach((appoint) { response['AppoimentAllHistoryResultList'].forEach((appoint) {
appointHistoryList appointHistoryList.add(AppoitmentAllHistoryResultList.fromJson(appoint));
.add(AppoitmentAllHistoryResultList.fromJson(appoint));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -24,6 +24,7 @@ class BloodPressureService extends BaseService {
monthDiabtectResultAverageList.clear(); monthDiabtectResultAverageList.clear();
weekDiabtectResultAverageList.clear(); weekDiabtectResultAverageList.clear();
yearDiabtecResultAverageList.clear(); yearDiabtecResultAverageList.clear();
response['List_MonthBloodPressureResultAverage'].forEach((item) { response['List_MonthBloodPressureResultAverage'].forEach((item) {
monthDiabtectResultAverageList monthDiabtectResultAverageList
.add(MonthBloodPressureResultAverage.fromJson(item)); .add(MonthBloodPressureResultAverage.fromJson(item));
@ -111,6 +112,7 @@ class BloodPressureService extends BaseService {
{String bloodPressureDate, {String bloodPressureDate,
String diastolicPressure, String diastolicPressure,
String systolicePressure, String systolicePressure,
int lineItemNo,
int measuredArm}) async { int measuredArm}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
@ -120,6 +122,7 @@ class BloodPressureService extends BaseService {
body['DiastolicPressure'] = diastolicPressure; body['DiastolicPressure'] = diastolicPressure;
body['SystolicePressure'] = systolicePressure; body['SystolicePressure'] = systolicePressure;
body['MeasuredArm'] ='$measuredArm'; body['MeasuredArm'] ='$measuredArm';
body['LineItemNo'] = lineItemNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_BLOOD_PRESSURE_RESULT, await baseAppClient.post(UPDATE_BLOOD_PRESSURE_RESULT,

@ -20,10 +20,10 @@ class WeightService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
monthWeightMeasurementResultAverage.clear();
weekWeightMeasurementResultAverage.clear();
yearWeightMeasurementResultAverage.clear();
await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) {
monthWeightMeasurementResultAverage.clear();
weekWeightMeasurementResultAverage.clear();
yearWeightMeasurementResultAverage.clear();
response['List_MonthWeightMeasurementResultAverage'].forEach((item) { response['List_MonthWeightMeasurementResultAverage'].forEach((item) {
monthWeightMeasurementResultAverage.add(MonthWeightMeasurementResultAverage.fromJson(item)); monthWeightMeasurementResultAverage.add(MonthWeightMeasurementResultAverage.fromJson(item));
}); });
@ -43,10 +43,10 @@ class WeightService extends BaseService {
Future getWeightMeasurementResult() async { Future getWeightMeasurementResult() async {
hasError = false; hasError = false;
monthWeightMeasurementResult.clear();
weekWeightMeasurementResult.clear();
yearWeightMeasurementResult.clear();
await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, onSuccess: (dynamic response, int statusCode) {
monthWeightMeasurementResult.clear();
weekWeightMeasurementResult.clear();
yearWeightMeasurementResult.clear();
response['List_WeekWeightMeasurementResult'].forEach((item) { response['List_WeekWeightMeasurementResult'].forEach((item) {
weekWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); weekWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item));

@ -34,10 +34,10 @@ class PrescriptionsService extends BaseService {
} }
Future getPrescriptionsOrders() async { Future getPrescriptionsOrders() async {
prescriptionsOrderList.clear();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) {
prescriptionsOrderList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) { response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) {
prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder)); prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
}); });

@ -9,14 +9,19 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_p
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/widgets/charts/custom_line_chart.dart';
import '../../../locator.dart'; import '../../../locator.dart';
class H2OViewModel extends BaseViewModel { class H2OViewModel extends BaseViewModel {
H2OService _h2OService = locator<H2OService>(); H2OService _h2OService = locator<H2OService>();
List<charts.Series> userProgressForWeekDataSeries; //
List<charts.Series> userProgressForMonthDataSeries; // List<charts.Series> userProgressForWeekDataSeries;
List<LineChartModel> userProgressForWeekDataSeries;
List<LineChartModel> userProgressForMonthDataSeries;
// List<charts.Series> userProgressForMonthDataSeries;
UserDetailModel get userDetail => _h2OService.userDetailModel; UserDetailModel get userDetail => _h2OService.userDetailModel;
@ -71,7 +76,8 @@ class H2OViewModel extends BaseViewModel {
error = _h2OService.error; error = _h2OService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
userProgressForWeekDataSeries = createUserProgressForWeekDataSeries(); // userProgressForWeekDataSeries = createUserProgressForWeekDataSeries();
userProgressForWeekDataSeries = createUserProgressForWeekDataSeriesNew();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -83,7 +89,7 @@ class H2OViewModel extends BaseViewModel {
error = _h2OService.error; error = _h2OService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
userProgressForMonthDataSeries = createUserProgressForMonthDataSeries(); userProgressForMonthDataSeries = createUserProgressForMonthDataSeriesNew();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -113,6 +119,23 @@ class H2OViewModel extends BaseViewModel {
]; ];
} }
List<LineChartModel> createUserProgressForWeekDataSeriesNew() {
List<LineChartModel> list = [];
_h2OService.userProgressForWeekDataList.forEach((UserProgressForWeekDataModel data) {
list.add(new LineChartModel(data.dayName, data.percentageConsumed));
});
return list;
}
List<LineChartModel> createUserProgressForMonthDataSeriesNew() {
List<LineChartModel> list = [];
_h2OService.userProgressForMonthDataList.forEach((UserProgressForMonthDataModel data) {
list.add(new LineChartModel(data.monthName, data.percentageConsumed));
});
return list;
}
List<charts.Series<ChartSeries, String>> createUserProgressForMonthDataSeries() { List<charts.Series<ChartSeries, String>> createUserProgressForMonthDataSeries() {
List<ChartSeries> globalData = []; List<ChartSeries> globalData = [];
_h2OService.userProgressForMonthDataList.forEach((UserProgressForMonthDataModel data) { _h2OService.userProgressForMonthDataList.forEach((UserProgressForMonthDataModel data) {

@ -38,9 +38,6 @@ class CMCViewModel extends BaseViewModel {
Future getCMCAllServices() async { Future getCMCAllServices() async {
await _cMCService.getCMCAllServices(); await _cMCService.getCMCAllServices();
CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD);
await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel, isFirst: true);
if (_cMCService.hasError) { if (_cMCService.hasError) {
error = _cMCService.error; error = _cMCService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -92,7 +89,6 @@ class CMCViewModel extends BaseViewModel {
await _cMCService.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); await _cMCService.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel);
} }
//TODO check it in uat
Future<String> insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { Future<String> insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
order.createdBy = user.patientID; order.createdBy = user.patientID;
@ -104,7 +100,20 @@ class CMCViewModel extends BaseViewModel {
} else { } else {
getCmcAllPresOrders(); getCmcAllPresOrders();
} }
return requestId;
}
Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy);
order.createdBy = user.patientID;
order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService();
String requestId = await _cMCService.insertCMCOrderRC(order: order);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.ErrorLocal);
} else {
getCmcAllPresOrders();
}
return requestId; return requestId;
} }

@ -21,6 +21,7 @@ class DashboardViewModel extends BaseViewModel {
if (isLogin && _vitalSignService.weightKg.isEmpty) { if (isLogin && _vitalSignService.weightKg.isEmpty) {
setState(ViewState.Busy); setState(ViewState.Busy);
await _vitalSignService.getPatientRadOrders(); await _vitalSignService.getPatientRadOrders();
if (_vitalSignService.hasError) { if (_vitalSignService.hasError) {
error = _vitalSignService.error; error = _vitalSignService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -6,37 +6,18 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
import '../../../locator.dart'; import '../../../locator.dart';
enum MessageType { enum MessageType { ComplaintOnAnAppointment, ComplaintWithoutAppointment, Question, Compliment, Suggestion, NON }
ComplaintOnAnAppointment,
ComplaintWithoutAppointment,
Question,
Compliment,
Suggestion,
NON
}
class FeedbackViewModel extends BaseViewModel { class FeedbackViewModel extends BaseViewModel {
FeedbackService _feedbackService = locator<FeedbackService>(); FeedbackService _feedbackService = locator<FeedbackService>();
List<COCItem> get cOCItemList => _feedbackService.cOCItemList; List<COCItem> get cOCItemList => _feedbackService.cOCItemList;
List<AppoitmentAllHistoryResultList> get appointHistoryList => _feedbackService.appointHistoryList;
List<AppoitmentAllHistoryResultList> get appointHistoryList => Future<bool> sendCOCItem({String title, String details, String cOCTypeName, String attachment, AppoitmentAllHistoryResultList appointHistory}) async {
_feedbackService.appointHistoryList;
Future<bool> sendCOCItem(
{String title,
String details,
String cOCTypeName,
String attachment,
AppoitmentAllHistoryResultList appointHistory}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _feedbackService.sendCOCItem( await _feedbackService.sendCOCItem(title: title, details: details, cOCTypeName: cOCTypeName, attachment: attachment, appointHistory: appointHistory);
title: title,
details: details,
cOCTypeName: cOCTypeName,
attachment: attachment,
appointHistory: appointHistory);
if (_feedbackService.hasError) { if (_feedbackService.hasError) {
error = _feedbackService.error; error = _feedbackService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -58,7 +39,18 @@ class FeedbackViewModel extends BaseViewModel {
} }
} }
Future getPatentAppointmentHistory() async { searchFeedback(String countryCode, String phoneNumber, int type, String idNumber) async {
setState(ViewState.Busy);
await _feedbackService.searchFeedback(countryCode, phoneNumber, type, idNumber);
if (_feedbackService.hasError) {
error = _feedbackService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future getPatentAppointmentHistory() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _feedbackService.getPatentAppointmentHistory(); await _feedbackService.getPatentAppointmentHistory();
if (_feedbackService.hasError) { if (_feedbackService.hasError) {

@ -75,17 +75,17 @@ class BloodPressureViewMode extends BaseViewModel {
} }
} }
Future addORUpdateDiabtecResult({String bloodPressureDate, String diastolicPressure, String systolicePressure, int measuredArm, bool isUpdate = false}) async { Future addORUpdateDiabtecResult({String bloodPressureDate, String diastolicPressure, String systolicePressure, int measuredArm, int lineItemNo, bool isUpdate = false}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
if (!isUpdate) if (!isUpdate)
await bloodPressureService.addDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm); await bloodPressureService.addDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm);
else else
await bloodPressureService.updateDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm); await bloodPressureService.updateDiabtecResult(bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm, lineItemNo: lineItemNo);
if (bloodPressureService.hasError) { if (bloodPressureService.hasError) {
error = bloodPressureService.error; error = bloodPressureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await getBloodPressure(); // await getBloodPressure();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -77,14 +77,17 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
getPrescriptionsOrders({bool showLoading = false}) async { getPrescriptionsOrders({bool showLoading = false}) async {
if (showLoading) setState(ViewState.Busy); // print(showLoading);
await _prescriptionsService.getPrescriptionsOrders(); setState(ViewState.Busy);
if (_prescriptionsService.hasError) { Future.delayed(new Duration(milliseconds: 300)).then((value) async {
error = _prescriptionsService.error; await _prescriptionsService.getPrescriptionsOrders();
setState(ViewState.ErrorLocal); if (_prescriptionsService.hasError) {
} else { error = _prescriptionsService.error;
setState(ViewState.Idle); setState(ViewState.ErrorLocal);
} } else {
setState(ViewState.Idle);
}
});
} }
setFilterType(FilterType filterType) { setFilterType(FilterType filterType) {

@ -39,6 +39,7 @@ class AppoitmentAllHistoryResultList {
String doctorImageURL; String doctorImageURL;
String doctorNameObj; String doctorNameObj;
int doctorRate; int doctorRate;
dynamic decimalDoctorRate;
List<String> doctorSpeciality; List<String> doctorSpeciality;
String doctorTitle; String doctorTitle;
int gender; int gender;
@ -108,6 +109,7 @@ class AppoitmentAllHistoryResultList {
this.doctorImageURL, this.doctorImageURL,
this.doctorNameObj, this.doctorNameObj,
this.doctorRate, this.doctorRate,
this.decimalDoctorRate,
this.doctorSpeciality, this.doctorSpeciality,
this.doctorTitle, this.doctorTitle,
this.gender, this.gender,
@ -176,6 +178,7 @@ class AppoitmentAllHistoryResultList {
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorNameObj = json['DoctorNameObj']; doctorNameObj = json['DoctorNameObj'];
doctorRate = json['DoctorRate']; doctorRate = json['DoctorRate'];
decimalDoctorRate = json['DecimalDoctorRate'];
doctorSpeciality = json['DoctorSpeciality'] != null doctorSpeciality = json['DoctorSpeciality'] != null
? json['DoctorSpeciality'].cast<String>() ? json['DoctorSpeciality'].cast<String>()
: ["null"]; : ["null"];
@ -250,6 +253,7 @@ class AppoitmentAllHistoryResultList {
data['DoctorImageURL'] = this.doctorImageURL; data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorNameObj'] = this.doctorNameObj; data['DoctorNameObj'] = this.doctorNameObj;
data['DoctorRate'] = this.doctorRate; data['DoctorRate'] = this.doctorRate;
data['DecimalDoctorRate'] = this.decimalDoctorRate;
data['DoctorSpeciality'] = this.doctorSpeciality; data['DoctorSpeciality'] = this.doctorSpeciality;
data['DoctorTitle'] = this.doctorTitle; data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender; data['Gender'] = this.gender;

@ -40,6 +40,7 @@ class DoctorList {
String setupID; String setupID;
List<String> speciality; List<String> speciality;
dynamic workingHours; dynamic workingHours;
dynamic decimalDoctorRate;
DoctorList( DoctorList(
{this.clinicID, {this.clinicID,
@ -82,7 +83,8 @@ class DoctorList {
this.serviceID, this.serviceID,
this.setupID, this.setupID,
this.speciality, this.speciality,
this.workingHours}); this.workingHours,
this.decimalDoctorRate});
DoctorList.fromJson(Map<String, dynamic> json) { DoctorList.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
@ -127,6 +129,7 @@ class DoctorList {
if (json.containsKey('Speciality') && json['Speciality']!=null) if (json.containsKey('Speciality') && json['Speciality']!=null)
speciality = json['Speciality'].cast<String>(); speciality = json['Speciality'].cast<String>();
workingHours = json['WorkingHours']; workingHours = json['WorkingHours'];
decimalDoctorRate = json['DecimalDoctorRate'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -172,6 +175,7 @@ class DoctorList {
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality; data['Speciality'] = this.speciality;
data['WorkingHours'] = this.workingHours; data['WorkingHours'] = this.workingHours;
data['DecimalDoctorRate'] = this.decimalDoctorRate;
return data; return data;
} }
} }

@ -35,6 +35,7 @@ class DoctorProfileList {
int actualDoctorRate; int actualDoctorRate;
String doctorImageURL; String doctorImageURL;
int doctorRate; int doctorRate;
double decimalDoctorRate;
String doctorTitleForProfile; String doctorTitleForProfile;
bool isAppointmentAllowed; bool isAppointmentAllowed;
String nationalityFlagURL; String nationalityFlagURL;
@ -79,6 +80,7 @@ class DoctorProfileList {
this.actualDoctorRate, this.actualDoctorRate,
this.doctorImageURL, this.doctorImageURL,
this.doctorRate, this.doctorRate,
this.decimalDoctorRate,
this.doctorTitleForProfile, this.doctorTitleForProfile,
this.isAppointmentAllowed, this.isAppointmentAllowed,
this.nationalityFlagURL, this.nationalityFlagURL,
@ -123,6 +125,7 @@ class DoctorProfileList {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate']; doctorRate = json['DoctorRate'];
decimalDoctorRate = json['DecimalDoctorRate'];
doctorTitleForProfile = json['DoctorTitleForProfile']; doctorTitleForProfile = json['DoctorTitleForProfile'];
isAppointmentAllowed = json['IsAppointmentAllowed']; isAppointmentAllowed = json['IsAppointmentAllowed'];
nationalityFlagURL = json['NationalityFlagURL']; nationalityFlagURL = json['NationalityFlagURL'];
@ -169,6 +172,7 @@ class DoctorProfileList {
data['ActualDoctorRate'] = this.actualDoctorRate; data['ActualDoctorRate'] = this.actualDoctorRate;
data['DoctorImageURL'] = this.doctorImageURL; data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate; data['DoctorRate'] = this.doctorRate;
data['DecimalDoctorRate'] = this.decimalDoctorRate;
data['DoctorTitleForProfile'] = this.doctorTitleForProfile; data['DoctorTitleForProfile'] = this.doctorTitleForProfile;
data['IsAppointmentAllowed'] = this.isAppointmentAllowed; data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
data['NationalityFlagURL'] = this.nationalityFlagURL; data['NationalityFlagURL'] = this.nationalityFlagURL;

@ -4,13 +4,15 @@ class DoctorRateDetails {
dynamic clinicID; dynamic clinicID;
dynamic rate; dynamic rate;
dynamic patientNumber; dynamic patientNumber;
dynamic ratio;
DoctorRateDetails( DoctorRateDetails(
{this.doctorID, {this.doctorID,
this.projectID, this.projectID,
this.clinicID, this.clinicID,
this.rate, this.rate,
this.patientNumber}); this.patientNumber,
this.ratio});
DoctorRateDetails.fromJson(Map<String, dynamic> json) { DoctorRateDetails.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
@ -18,6 +20,7 @@ class DoctorRateDetails {
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
rate = json['Rate']; rate = json['Rate'];
patientNumber = json['PatientNumber']; patientNumber = json['PatientNumber'];
ratio = json['Ratio'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -27,6 +30,7 @@ class DoctorRateDetails {
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['Rate'] = this.rate; data['Rate'] = this.rate;
data['PatientNumber'] = this.patientNumber; data['PatientNumber'] = this.patientNumber;
data['Ratio'] = this.ratio;
return data; return data;
} }
} }

@ -14,6 +14,8 @@ class CheckPatientForRegistration {
String tokenID; String tokenID;
int patientID; int patientID;
bool isRegister; bool isRegister;
String dob;
int isHijri;
CheckPatientForRegistration( CheckPatientForRegistration(
{this.patientIdentificationID, {this.patientIdentificationID,
@ -30,7 +32,9 @@ class CheckPatientForRegistration {
this.deviceTypeID, this.deviceTypeID,
this.tokenID, this.tokenID,
this.patientID, this.patientID,
this.isRegister}); this.isRegister,
this.dob,
this.isHijri});
CheckPatientForRegistration.fromJson(Map<String, dynamic> json) { CheckPatientForRegistration.fromJson(Map<String, dynamic> json) {
patientIdentificationID = json['PatientIdentificationID']; patientIdentificationID = json['PatientIdentificationID'];
@ -48,6 +52,8 @@ class CheckPatientForRegistration {
tokenID = json['TokenID']; tokenID = json['TokenID'];
patientID = json['PatientID']; patientID = json['PatientID'];
isRegister = json['isRegister']; isRegister = json['isRegister'];
dob = json['DOB'];
isHijri = json['IsHijri'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -67,6 +73,8 @@ class CheckPatientForRegistration {
data['TokenID'] = this.tokenID; data['TokenID'] = this.tokenID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['isRegister'] = this.isRegister; data['isRegister'] = this.isRegister;
data['DOB'] = dob;
data['IsHijri'] = isHijri;
return data; return data;
} }
} }

@ -34,10 +34,13 @@ class ListDentalAppointments {
int invoiceNo; int invoiceNo;
int status; int status;
String arrivedOn; String arrivedOn;
String doctorName; dynamic doctorName;
dynamic doctorNameN; String doctorNameN;
String clinicName; String clinicName;
dynamic decimalDoctorRate;
String doctorImageURL; String doctorImageURL;
dynamic doctorRate;
int patientNumber;
String projectName; String projectName;
ListDentalAppointments( ListDentalAppointments(
@ -55,7 +58,10 @@ class ListDentalAppointments {
this.doctorName, this.doctorName,
this.doctorNameN, this.doctorNameN,
this.clinicName, this.clinicName,
this.decimalDoctorRate,
this.doctorImageURL, this.doctorImageURL,
this.doctorRate,
this.patientNumber,
this.projectName}); this.projectName});
ListDentalAppointments.fromJson(Map<String, dynamic> json) { ListDentalAppointments.fromJson(Map<String, dynamic> json) {
@ -73,7 +79,10 @@ class ListDentalAppointments {
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN']; doctorNameN = json['DoctorNameN'];
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
decimalDoctorRate = json['DecimalDoctorRate'];
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
patientNumber = json['PatientNumber'];
projectName = json['ProjectName']; projectName = json['ProjectName'];
} }
@ -93,8 +102,12 @@ class ListDentalAppointments {
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN; data['DoctorNameN'] = this.doctorNameN;
data['ClinicName'] = this.clinicName; data['ClinicName'] = this.clinicName;
data['DecimalDoctorRate'] = this.decimalDoctorRate;
data['DoctorImageURL'] = this.doctorImageURL; data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['PatientNumber'] = this.patientNumber;
data['ProjectName'] = this.projectName; data['ProjectName'] = this.projectName;
return data; return data;
} }
} }

@ -11,8 +11,9 @@ class HeaderModel {
int doctorRate; int doctorRate;
int actualDoctorRate; int actualDoctorRate;
int totalReviews; int totalReviews;
String decimalDoctorRate;
String email; String email;
HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate,
this.actualDoctorRate, this.totalReviews, this.email); this.actualDoctorRate, this.totalReviews, this.email, {this.decimalDoctorRate = null});
} }

@ -46,11 +46,11 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[0].price, price: widget.model.cmcAllServicesList[0].price,
serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(),
selectedServiceName: widget.model.cmcAllServicesList[0].description, selectedServiceName: widget.model.cmcAllServicesList[0].text,
selectedServiceNameAR: widget.model.cmcAllServicesList[0].descriptionN, selectedServiceNameAR: widget.model.cmcAllServicesList[0].textN,
recordID: 1, recordID: 1,
totalPrice: widget.model.cmcAllServicesList[0].totalPrice, totalPrice: widget.model.cmcAllServicesList[0].priceTotal,
vAT: widget.model.cmcAllServicesList[0].vAT); vAT: widget.model.cmcAllServicesList[0].priceVAT);
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]);
} }

@ -63,18 +63,18 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
return Row( return Row(
children: [ children: [
Radio( Radio(
value: widget.model.cmcAllServicesList[index].serviceID, value: num.tryParse(widget.model.cmcAllServicesList[index].serviceID),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (newValue) async { onChanged: (newValue) async {
selectedItem = index; selectedItem = index;
PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[index].price, price: widget.model.cmcAllServicesList[index].price,
serviceID: widget.model.cmcAllServicesList[index].serviceID.toString(), serviceID: widget.model.cmcAllServicesList[index].serviceID,
selectedServiceName: widget.model.cmcAllServicesList[index].description, selectedServiceName: widget.model.cmcAllServicesList[index].text,
selectedServiceNameAR: widget.model.cmcAllServicesList[index].descriptionN, selectedServiceNameAR: widget.model.cmcAllServicesList[index].textN,
recordID: 1, recordID: 1,
totalPrice: widget.model.cmcAllServicesList[index].totalPrice, totalPrice: widget.model.cmcAllServicesList[index].priceTotal,
vAT: widget.model.cmcAllServicesList[index].vAT); vAT: widget.model.cmcAllServicesList[index].priceVAT);
setState(() { setState(() {
widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
}); });
@ -93,7 +93,7 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
bottom: 20, bottom: 20,
), ),
child: Text( child: Text(
projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].descriptionN : widget.model.cmcAllServicesList[index].description, projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].textN : widget.model.cmcAllServicesList[index].text,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -135,50 +135,6 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
), ),
], ],
), ),
// Card(
// shape: cardRadius(12),
// elevation: 4,
// child: Container(
// width: double.infinity,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Padding(
// padding: const EdgeInsets.only(left: 12, right: 12, top: 12),
// child: Text(
// TranslationBase.of(context).coveredService,
// style: TextStyle(
// fontSize: 14,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// ),
// ListView.separated(
// itemBuilder: (context, index) {
// return Padding(
// padding: const EdgeInsets.all(12.0),
// child: Text(
// widget.model.checkupItems[index].itemName,
// style: TextStyle(
// fontSize: 12,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// );
// },
// separatorBuilder: (context, index) {
// return mDivider(Colors.grey);
// },
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemCount: widget.model.checkupItems.length,
// ),
// ],
// ),
// ),
// ),
], ],
), ),
), ),
@ -194,13 +150,16 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[selectedItem].price, price: widget.model.cmcAllServicesList[selectedItem].price,
serviceID: widget.model.cmcAllServicesList[selectedItem].serviceID.toString(), serviceID: widget.model.cmcAllServicesList[selectedItem].serviceID.toString(),
selectedServiceName: widget.model.cmcAllServicesList[selectedItem].description, selectedServiceName: widget.model.cmcAllServicesList[selectedItem].text,
selectedServiceNameAR: widget.model.cmcAllServicesList[selectedItem].descriptionN, selectedServiceNameAR: widget.model.cmcAllServicesList[selectedItem].textN,
recordID: 1, recordID: 1,
totalPrice: widget.model.cmcAllServicesList[selectedItem].totalPrice, totalPrice: widget.model.cmcAllServicesList[selectedItem].priceTotal,
vAT: widget.model.cmcAllServicesList[selectedItem].vAT, vAT: widget.model.cmcAllServicesList[selectedItem].priceVAT,
); );
widget.cMCInsertPresOrderRequestModel.patientID = projectViewModel.user.patientID;
widget.cMCInsertPresOrderRequestModel.patientOutSA = projectViewModel.user.outSA;
widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
await widget.model.getCustomerInfo(); await widget.model.getCustomerInfo();
// if (widget.model.state == ViewState.ErrorLocal) { // if (widget.model.state == ViewState.ErrorLocal) {

@ -202,7 +202,7 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
color: CustomColors.green, color: CustomColors.green,
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
String requestId = await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); String requestId = await widget.model.insertCMCOrderRC(order: widget.cmcInsertPresOrderRequestModel);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state != ViewState.ErrorLocal) { if (widget.model.state != ViewState.ErrorLocal) {
//show scuccess dialog //show scuccess dialog

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -28,6 +29,29 @@ class OrdersLogDetailsPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.updateCmcPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getCmcAllPresOrders();
GifLoaderDialogUtils.hideDialog(context);
}
});
},
));
return;
// todo 'sikander' remove useless code
showDialog( showDialog(
context: context, context: context,
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(

@ -1,5 +1,8 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'new_e_referral_step_three_page.dart'; import 'new_e_referral_step_three_page.dart';
@ -9,18 +12,15 @@ class StartIndexForNewEReferral extends StatefulWidget {
StartIndexForNewEReferral(); StartIndexForNewEReferral();
@override @override
_StartIndexForNewEReferralState createState() => _StartIndexForNewEReferralState createState() => _StartIndexForNewEReferralState();
_StartIndexForNewEReferralState();
} }
class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral> class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral> with TickerProviderStateMixin {
with TickerProviderStateMixin {
PageController _controller; PageController _controller;
int _currentIndex = 1; int _currentIndex = 0;
int pageSelected = 2; int pageSelected = 2;
CreateEReferralRequestModel createEReferralRequestModel = CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel();
new CreateEReferralRequestModel();
@override @override
void initState() { void initState() {
@ -40,37 +40,139 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: SafeArea( body: Container(
child: SingleChildScrollView( height: double.infinity,
child: Container( child: Column(
height: MediaQuery.of(context).size.height * 0.78, children: [
child: PageView( Container(
physics: NeverScrollableScrollPhysics(), width: double.infinity,
controller: _controller, padding: EdgeInsets.only(left: 12,right: 12,top: 12),
onPageChanged: (index) { child: Row(
setState(() { children: [
_currentIndex = index; Expanded(
}); child: showProgress(
}, title: TranslationBase.of(context).RequesterInfo,
scrollDirection: Axis.horizontal, status: _currentIndex == 0
children: <Widget>[ ? TranslationBase.of(context).inPrgress
NewEReferralStepOnePage( : _currentIndex > 0
changePageViewIndex: changePageViewIndex, ? TranslationBase.of(context).completed
createEReferralRequestModel: createEReferralRequestModel, : TranslationBase.of(context).locked,
), color: _currentIndex == 0 ? CustomColors.orange : CustomColors.green,
NewEReferralStepTowPage( ),
changePageViewIndex: changePageViewIndex, ),
createEReferralRequestModel: createEReferralRequestModel, Expanded(
), child: showProgress(
NewEReferralStepThreePage( title: TranslationBase.of(context).patientInfo,
changePageViewIndex: changePageViewIndex, status: _currentIndex == 1
createEReferralRequestModel: createEReferralRequestModel, ? TranslationBase.of(context).inPrgress
), : _currentIndex > 1
], ? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: _currentIndex == 1
? CustomColors.orange
: _currentIndex > 1
? CustomColors.green
: CustomColors.grey2,
),
),
showProgress(
title: TranslationBase.of(context).otherInfo,
status: _currentIndex == 2 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked,
color: _currentIndex == 2
? CustomColors.orange
: _currentIndex > 3
? CustomColors.green
: CustomColors.grey2,
isNeedBorder: false,
),
],
),
), ),
), Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NewEReferralStepOnePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),
),
],
), ),
), ),
); );
} }
Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: 26,
height: 26,
decoration: containerRadius(color, 200),
child: Icon(
Icons.done,
color: Colors.white,
size: 16,
),
),
if (isNeedBorder)
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: mDivider(Colors.grey),
)),
],
),
mHeight(8),
Text(
title,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
letterSpacing: -0.44,
),
),
mHeight(2),
Container(
padding: EdgeInsets.all(5),
decoration: containerRadius(color.withOpacity(0.2), 4),
child: Text(
status,
style: TextStyle(
fontSize: 8,
fontWeight: FontWeight.w600,
letterSpacing: -0.32,
color: color,
),
),
),
],
)
],
);
}
} }

@ -8,15 +8,16 @@ import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -35,13 +36,14 @@ class NewEReferralStepOnePage extends StatefulWidget {
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> { class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
TextEditingController _nameTextController = TextEditingController(); TextEditingController _nameTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController();
GetAllRelationshipTypeResponseModel _selectedRelation; GetAllRelationshipTypeResponseModel _selectedRelation;
String email; String email;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel(); AdvanceModel advanceModel = AdvanceModel();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
String mobileNo = "";
// todo create a model for Country // todo create a model for Country
// todo use country from the json // todo use country from the json
@ -54,147 +56,154 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
super.initState(); super.initState();
} }
void showSMSDialog(EReferralViewModel model) {
SMSOTP(
context,
1,
_selectedCountry['code'] + mobileNo,
(value) {
submit(model, value);
},
() => {
Navigator.pop(context),
},
).displayDialog(context);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
void showSMSDialog(EReferralViewModel model) {
SMSOTP(
context,
1,
_selectedCountry['code'] + _mobileTextController.text,
(value) {
submit(model, value);
},
() => {
Navigator.pop(context),
},
).displayDialog(context);
// showDialog(
// context: context,
// barrierDismissible: false,
// child: EReferralConfirmSMSDialog(
// phoneNumber: _selectedCountry['code'] + _mobileTextController.text,
// onSucces: () {
// Navigator.of(context).pop();
// widget.changePageViewIndex(1);
// widget.createEReferralRequestModel.requesterName =
// _nameTextController.text;
// widget.createEReferralRequestModel.requesterContactNo =
// _selectedCountry['code'].toString().substring(1) +
// _mobileTextController.text;
// widget.createEReferralRequestModel.requesterRelationship =
// _selectedRelation.iD;
// }),
// ).then((value) {
// print("dialog dismissed");
// print(value);
// if (value != null && value) {}
// });
}
return BaseView<EReferralViewModel>( return BaseView<EReferralViewModel>(
onModelReady: (model) => model.getRelationTypes(), onModelReady: (model) => model.getRelationTypes(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( backgroundColor: CustomColors.appBackgroudGrey2Color,
physics: ScrollPhysics(), body: Container(
child: Container( child: Column(
margin: EdgeInsets.all(12), children: [
child: Center( Expanded(
child: Column( child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, physics: ScrollPhysics(),
children: [ child: Container(
SizedBox( margin: EdgeInsets.all(12),
height: 20, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
Center( children: [
child: Texts( SizedBox(
TranslationBase.of(context).referralRequesterInformation, height: 20,
), ),
), Text(
SizedBox( TranslationBase.of(context).referralRequesterInformation,
height: 12, style: TextStyle(
), fontSize: 16,
NewTextFields( fontWeight: FontWeight.w600,
hintText: TranslationBase.of(context).enterReferralRequesterName, letterSpacing: -0.64,
controller: _nameTextController,
),
SizedBox(
height: 12,
),
InkWell(
onTap: () => confirmSelectCountryTypeDialog(),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
), ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12,
),
MobileNumberTextFiled(
controller: _mobileTextController,
code: _selectedCountry == null ? "11" : _selectedCountry["code"],
),
SizedBox(
height: 12,
),
Center(
child: Texts(
TranslationBase.of(context).requesterRelationship,
textAlign: TextAlign.center,
), ),
), inputWidget(TranslationBase.of(context).enterReferralRequesterName, "", _nameTextController, isInputTypeNum: false),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
InkWell( PhoneNumberSelectorWidget(onNumberChange: (value) {
onTap: () => confirmSelectRelationTypeDialog(model.relationTypes), setState(() {
child: Container( mobileNo = value;
padding: EdgeInsets.all(12), });
width: double.infinity, }, onCountryChange: (value) {
height: 65, setState(() {
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), _selectedCountry = value;
child: Row( });
mainAxisAlignment: MainAxisAlignment.spaceBetween, }),
children: [Texts(getRelationName()), Icon(Icons.arrow_drop_down)], SizedBox(
height: 12,
),
Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: () => confirmSelectRelationTypeDialog(model.relationTypes),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectRelationship,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getRelationName(),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
],
),
), ),
), ),
), ],
], ),
), ),
), ),
), ),
), Card(
bottomSheet: Container( margin: EdgeInsets.zero,
color: Theme.of(context).scaffoldBackgroundColor, shape: cardRadius(0),
width: double.infinity, elevation: 20,
padding: EdgeInsets.all(9), child: Container(
child: DefaultButton( // color: Theme.of(context).scaffoldBackgroundColor,
TranslationBase.of(context).next, padding: EdgeInsets.all(12),
(_nameTextController.text.isEmpty || _selectedRelation == null || _mobileTextController.text.isEmpty) width: double.infinity,
? null child: DefaultButton(
: () async { TranslationBase.of(context).next,
Future.delayed(new Duration(milliseconds: 300)).then((value) async { (_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty)
GifLoaderDialogUtils.showMyDialog(context); ? null
SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( : () async {
zipCode: _selectedCountry['code'], Future.delayed(new Duration(milliseconds: 300)).then((value) async {
patientMobileNumber: int.parse(_mobileTextController.text), GifLoaderDialogUtils.showMyDialog(context);
); SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel(
await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); zipCode: _selectedCountry['code'],
GifLoaderDialogUtils.hideDialog(context); patientMobileNumber: int.parse(mobileNo),
showSMSDialog(model); );
}); await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
}, GifLoaderDialogUtils.hideDialog(context);
disabledColor: Colors.grey, showSMSDialog(model);
});
},
disabledColor: Colors.grey,
),
),
), ),
))); ],
),
),
),
);
} }
void submit(EReferralViewModel model, code) async { void submit(EReferralViewModel model, code) async {
@ -205,12 +214,16 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel); await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: model.error);
showSMSDialog(model);
});
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(); Navigator.of(context).pop();
widget.changePageViewIndex(1); widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName = _nameTextController.text; widget.createEReferralRequestModel.requesterName = _nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + _mobileTextController.text; widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + mobileNo;
widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD; widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD;
} }
}); });
@ -231,20 +244,93 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
); );
} }
void confirmSelectCountryTypeDialog() { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
showDialog( {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
context: context, return Container(
child: SelectCountryDialog( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
selectedCountry: _selectedCountry, alignment: Alignment.center,
onValueSelected: (value) { decoration: BoxDecoration(
setState(() { borderRadius: BorderRadius.circular(15),
_selectedCountry = value; color: Colors.white,
}); border: Border.all(
}, color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
), ),
); );
} }
// void confirmSelectCountryTypeDialog() {
// showDialog(
// context: context,
// child: SelectCountryDialog(
// selectedCountry: _selectedCountry,
// onValueSelected: (value) {
// setState(() {
// _selectedCountry = value;
// });
// },
// ),
// );
// }
String getRelationName() { String getRelationName() {
if (_selectedRelation != null) { if (_selectedRelation != null) {
if (projectViewModel.isArabic) { if (projectViewModel.isArabic) {
@ -252,7 +338,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
} }
return _selectedRelation.textEn; return _selectedRelation.textEn;
} else } else
return TranslationBase.of(context).selectRelationship; return "";
} }
String getCountryName() { String getCountryName() {

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -66,316 +67,299 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Center( child: Column(
child: FractionallySizedBox( mainAxisAlignment: MainAxisAlignment.start,
widthFactor: 0.94, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
mainAxisAlignment: MainAxisAlignment.start, SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 20,
children: [ ),
SizedBox( Text(
height: 20, TranslationBase.of(context).otherInfo,
), style: TextStyle(
Center( fontSize: 16,
child: Texts( fontWeight: FontWeight.w600,
TranslationBase.of(context).otherInfo, letterSpacing: -0.64,
textAlign: TextAlign.center, ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Container(
Container( padding: EdgeInsets.all(12),
padding: EdgeInsets.only(top: 10), decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(12), color: Colors.white,
color: Colors.white, ),
), child: Row(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Expanded(
mainAxisAlignment: MainAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: [
padding: const EdgeInsets.symmetric(horizontal: 9), Text(
child: Texts( TranslationBase.of(context).medicalReport,
TranslationBase.of(context).medicalReport, style: TextStyle(
color: Colors.grey, fontSize: 12,
fontSize: 17, letterSpacing: -0.48,
), fontWeight: FontWeight.w600,
),
],
),
InkWell(
onTap: () {
ImageOptions.showImageOptions(
context,
(String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
medicalReportImages.add(eReferralAttachment);
});
},
);
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(7),
color: Colors.white,
shape: BoxShape.rectangle,
),
child: Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.attach_file),
Texts(
TranslationBase.of(context).selectAttachment,
variant: 'bodyText',
textAlign: TextAlign.center,
),
],
),
), ),
), ),
),
SizedBox( ...List.generate(
height: 12,
),
...List.generate(
medicalReportImages.length, medicalReportImages.length,
(index) => Container( (index) => Container(
margin: EdgeInsets.all(10), padding: EdgeInsets.only(top: 6,bottom: 6),
padding: EdgeInsets.all(8.0), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Texts(
crossAxisAlignment: CrossAxisAlignment.start, medicalReportImages[index].fileName,
children: <Widget>[
Icon(FontAwesomeIcons.paperclip),
SizedBox(
width: 8,
),
Texts(
medicalReportImages[index].fileName,
),
],
), ),
InkWell(
onTap: () {
setState(() {
medicalReportImages.remove(medicalReportImages[index]);
});
},
child: Icon(
FontAwesomeIcons.trashAlt,
color: Colors.red[300],
))
], ],
), ),
)), InkWell(
], onTap: () {
setState(() {
medicalReportImages.remove(medicalReportImages[index]);
});
},
child: Icon(
Icons.close,
color: Colors.red[300],
))
],
),
),
),
InkWell(
onTap: () {
ImageOptions.showImageOptions(
context,
(String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
medicalReportImages.add(eReferralAttachment);
});
},
);
},
child: Padding(
padding: EdgeInsets.only(top: 12,bottom: 12),
child: Text(
TranslationBase.of(context).selectAttachment,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
decoration: TextDecoration.underline,
color: CustomColors.accentColor,
),
),
),
),
],
),
), ),
), Icon(Icons.attach_file),
SizedBox( ],
height: 12, ),
), ),
Container( SizedBox(
padding: EdgeInsets.only(top: 10), height: 12,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), ),
child: Column( Container(
children: [ padding: EdgeInsets.only(top: 10),
Container( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
width: double.infinity, child: Column(
decoration: containerRadius(Colors.white, 12), children: [
margin: EdgeInsets.only(left: 20, right: 20), Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), width: double.infinity,
child: Row( decoration: containerRadius(Colors.white, 12),
children: [ margin: EdgeInsets.only(left: 20, right: 20),
Flexible( padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Flexible(
Text( child: Column(
TranslationBase.of(context).preferredBranch, crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle( children: [
fontSize: 11, Text(
letterSpacing: -0.44, TranslationBase.of(context).preferredBranch,
fontWeight: FontWeight.w600, style: TextStyle(
), fontSize: 11,
), letterSpacing: -0.44,
Container( fontWeight: FontWeight.w600,
height: 18, ),
child: DropdownButtonHideUnderline( ),
child: DropdownButton<String>( Container(
key: projectDropdownKey, height: 18,
hint: Text(TranslationBase.of(context).selectPreferredBranch), child: DropdownButtonHideUnderline(
value: projectDropdownValue, child: DropdownButton<String>(
iconSize: 0, key: projectDropdownKey,
isExpanded: true, hint: Text(TranslationBase.of(context).selectPreferredBranch),
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), value: projectDropdownValue,
items: projectsList.map((item) { iconSize: 0,
return new DropdownMenuItem<String>( isExpanded: true,
value: item.mainProjectID.toString() + "," + item.name.toString(), style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
child: new Text(item.name), items: projectsList.map((item) {
); return new DropdownMenuItem<String>(
}).toList(), value: item.mainProjectID.toString() + "," + item.name.toString(),
onChanged: (newValue) { child: new Text(item.name),
setState(() { );
projectDropdownValue = newValue; }).toList(),
print(projectDropdownValue); onChanged: (newValue) {
}); setState(() {
}, projectDropdownValue = newValue;
), print(projectDropdownValue);
), });
},
), ),
], ),
), ),
), ],
Icon(Icons.keyboard_arrow_down), ),
], ),
)), Icon(Icons.keyboard_arrow_down),
], ],
), )),
), ],
SizedBox( ),
height: 12, ),
), SizedBox(
Container( height: 12,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), ),
child: Column( Container(
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Row( Checkbox(
children: [ value: isPatientInsured,
Checkbox( activeColor: CustomColors.accentColor,
value: isPatientInsured, onChanged: (bool newValue) {
activeColor: Colors.black38, setState(() {
onChanged: (bool newValue) { isPatientInsured = newValue;
setState(() { });
isPatientInsured = newValue; }),
}); Padding(
}), padding: const EdgeInsets.all(5.0),
Padding( child: Text(
padding: const EdgeInsets.all(20.0), TranslationBase.of(context).insuredPatientReferral, style: TextStyle(
child: Texts( fontSize: 14,
TranslationBase.of(context).insuredPatientReferral, fontWeight: FontWeight.w600
fontSize: 17, ),
), ),
),
],
), ),
], ],
), ),
], ],
), ),
],
),
),
if (isPatientInsured)
SizedBox(
height: 12,
),
Opacity(
opacity: isPatientInsured ? 1 : 0,
child: Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
), ),
if (isPatientInsured) child: Row(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 12, children: [
), Expanded(
Opacity( child: Column(
opacity: isPatientInsured ? 1 : 0, crossAxisAlignment: CrossAxisAlignment.start,
child: Container( children: [
padding: EdgeInsets.only(top: 10), Text(
decoration: BoxDecoration( TranslationBase.of(context).medicalReport,
borderRadius: BorderRadius.circular(12), style: TextStyle(
color: Colors.white, fontSize: 12,
), letterSpacing: -0.48,
child: Column( fontWeight: FontWeight.w600,
children: [
InkWell(
onTap: () {
ImageOptions.showImageOptions(context, (String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
insuredPatientImages = [eReferralAttachment];
});
});
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(7),
color: Colors.white,
shape: BoxShape.rectangle,
),
child: Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.attach_file),
Texts(
'selected attachment',
variant: 'bodyText',
textAlign: TextAlign.center,
),
],
),
), ),
), ),
),
SizedBox( ...List.generate(
height: 12,
),
...List.generate(
insuredPatientImages.length, insuredPatientImages.length,
(index) => Container( (index) => Container(
margin: EdgeInsets.all(10), padding: EdgeInsets.only(top: 6,bottom: 6),
padding: EdgeInsets.all(8.0), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Texts(
crossAxisAlignment: CrossAxisAlignment.start, 'image ${index + 1}.png',
children: <Widget>[
Icon(FontAwesomeIcons.paperclip),
SizedBox(
width: 8,
),
Texts(
'image ${index + 1}.png',
),
],
), ),
InkWell(
onTap: () {
setState(() {
insuredPatientImages.remove(insuredPatientImages[index]);
});
},
child: Icon(
FontAwesomeIcons.trashAlt,
color: Colors.red[300],
))
], ],
), ),
)), InkWell(
], onTap: () {
setState(() {
insuredPatientImages.remove(insuredPatientImages[index]);
});
},
child: Icon(
Icons.close,
color: Colors.red[300],
),
)
],
),
),
),
InkWell(
onTap: () {
ImageOptions.showImageOptions(context, (String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
insuredPatientImages = [eReferralAttachment];
});
});
},
child: Padding(
padding: const EdgeInsets.only(top: 12,bottom: 12),
child: Text(
TranslationBase.of(context).selectAttachment,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
decoration: TextDecoration.underline,
color: CustomColors.accentColor,
),
),
),
),
],
),
), ),
), Icon(Icons.attach_file),
), ],
SizedBox(
height: 12,
), ),
], ),
), ),
), ],
), ),
), ),
), ),
@ -403,7 +387,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: "Referral sent successfully"); AppToast.showSuccessToast(message: TranslationBase.of(context).ereferralSaveSuccess);
} }
}); });
}, },
@ -485,6 +469,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
); );
} }
String getRelationName() { String getRelationName() {
if (_selectedCity != null) if (_selectedCity != null)
return _selectedCity.description; return _selectedCity.description;

@ -7,18 +7,20 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../dialogs/select_city_dialog.dart'; import '../dialogs/select_city_dialog.dart';
class NewEReferralStepTowPage extends StatefulWidget { class NewEReferralStepTowPage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel; final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
@ -32,20 +34,14 @@ class NewEReferralStepTowPage extends StatefulWidget {
class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> { class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
TextEditingController _patientNameTextController = TextEditingController(); TextEditingController _patientNameTextController = TextEditingController();
TextEditingController _patientIdentificationTextController = TextEditingController(); TextEditingController _patientIdentificationTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController(); String mobileNo = "";
GetAllCitiesResponseModel _selectedCity ; GetAllCitiesResponseModel _selectedCity;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
// todo create a model for Country // todo create a model for Country
// todo use country from the json // todo use country from the json
dynamic _selectedCountry = { dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
"name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية",
"code": "+966",
"countryCode": "SA",
"pattern": "5xxxxxxxx",
"maxLength": 9
};
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; AuthenticatedUser authUser;
@ -57,143 +53,222 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<EReferralViewModel>( return BaseView<EReferralViewModel>(
onModelReady: (model) => model.getAllCities(), onModelReady: (model) => model.getAllCities(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( backgroundColor: CustomColors.appBackgroudGrey2Color,
physics: ScrollPhysics(), body: Column(
child: Container( children: [
margin: EdgeInsets.all(12), Expanded(
child: Center( child: SingleChildScrollView(
child: FractionallySizedBox( physics: ScrollPhysics(),
widthFactor: 0.94, child: Container(
child: Column( margin: EdgeInsets.all(12),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: [
height: 30, SizedBox(
), height: 20,
Center( ),
child: Texts( Text(
TranslationBase.of(context).patientInfo, TranslationBase.of(context).patientInfo,
// "Patient information", style: TextStyle(
textAlign: TextAlign.center, fontSize: 16,
), fontWeight: FontWeight.w600,
), letterSpacing: -0.64,
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).enterIdentificationNumber,
controller: _patientIdentificationTextController,
keyboardType:TextInputType.number ,
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).patientName,
controller: _patientNameTextController,
),
SizedBox(
height: 12,
), ),
InkWell( ),
onTap: () => confirmSelectCountryTypeDialog(), SizedBox(
child: Container( height: 12,
padding: EdgeInsets.all(12), ),
width: double.infinity, inputWidget(TranslationBase.of(context).enterIdentificationNumber, "", _patientIdentificationTextController, isInputTypeNum: true),
height: 65, SizedBox(
decoration: BoxDecoration( height: 12,
borderRadius: BorderRadius.circular(12), ),
color: Colors.white), inputWidget(TranslationBase.of(context).patientName, "", _patientNameTextController, isInputTypeNum: false),
child: Row( SizedBox(
mainAxisAlignment: MainAxisAlignment.spaceBetween, height: 12,
children: [ ),
Texts(getCountryName()), PhoneNumberSelectorWidget(onNumberChange: (value) {
Icon(Icons.arrow_drop_down) setState(() {
], mobileNo = value;
), });
), }, onCountryChange: (value) {
), setState(() {
SizedBox( _selectedCountry = value;
height: 12, });
), }),
MobileNumberTextFiled( SizedBox(
controller: _mobileTextController, height: 12,
code: _selectedCountry == null ),
? "11" Text(
: _selectedCountry["code"], TranslationBase.of(context).patientLocated,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
), ),
SizedBox( ),
height: 12, SizedBox(
), height: 12,
Center( ),
child: Texts( Container(
TranslationBase.of(context).patientLocated, padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
textAlign: TextAlign.center, alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
), ),
), ),
SizedBox( child: InkWell(
height: 12, onTap: () => confirmSelectCityDialog(model.allCities),
), child: Row(
InkWell( children: [
onTap: () => confirmSelectCityDialog( Expanded(
model.allCities), child: Column(
child: Container( crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.all(12), children: [
width: double.infinity, Text(
height: 65, TranslationBase.of(context).selectCity,
decoration: BoxDecoration( style: TextStyle(
borderRadius: BorderRadius.circular(12), fontSize: 11,
color: Colors.white), fontWeight: FontWeight.w600,
child: Row( color: Color(0xff2B353E),
mainAxisAlignment: MainAxisAlignment.spaceBetween, letterSpacing: -0.44,
children: [ ),
Texts(getRelationName()), ),
Icon(Icons.arrow_drop_down) Text(
], getRelationName(),
), style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
],
), ),
), ),
SizedBox( ),
height: 12, SizedBox(
), height: 12,
),
SizedBox( ],
height: 12,
),
],
),
), ),
), ),
), ),
), ),
bottomSheet: Container( Card(
color: Theme.of(context).scaffoldBackgroundColor, margin: EdgeInsets.zero,
width: double.infinity, shape: cardRadius(0),
padding: EdgeInsets.all(9), elevation: 20,
child: DefaultButton( child: Container(
TranslationBase.of(context).next, width: double.infinity,
(_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty|| padding: EdgeInsets.all(12),
_selectedCity == null || child: DefaultButton(
_mobileTextController.text.isEmpty) ? null : () { TranslationBase.of(context).next,
this.widget.changePageViewIndex(2); (_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty || _selectedCity == null || mobileNo.isEmpty)
this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); ? null
this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; : () {
this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; this.widget.changePageViewIndex(2);
this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); this.widget.createEReferralRequestModel.identificationNo = int.parse(_patientIdentificationTextController.text);
this.widget.createEReferralRequestModel.cityName = _selectedCity.description; this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text;
}, this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1) + mobileNo;
disabledColor: Colors.grey, this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString();
this.widget.createEReferralRequestModel.cityName = _selectedCity.description;
},
disabledColor: Colors.grey,
),
), ),
))); )
],
),
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
} }
void confirmSelectCityDialog( void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) {
List<GetAllCitiesResponseModel> cities) {
showDialog( showDialog(
context: context, context: context,
child: SelectCityDialog( child: SelectCityDialog(
@ -238,12 +313,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
} }
class MobileNumberTextFiled extends StatelessWidget { class MobileNumberTextFiled extends StatelessWidget {
const MobileNumberTextFiled({ const MobileNumberTextFiled({Key key, this.controller, this.code}) : super(key: key);
Key key,
this.controller,
this.code
}) : super(key: key);
final TextEditingController controller; final TextEditingController controller;
final String code; final String code;
@ -252,8 +322,7 @@ class MobileNumberTextFiled extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.white),
borderRadius: BorderRadius.circular(15), color: Colors.white),
child: Row(children: <Widget>[ child: Row(children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
@ -274,8 +343,7 @@ class MobileNumberTextFiled extends StatelessWidget {
child: TextField( child: TextField(
controller: controller, controller: controller,
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
decoration: InputDecoration( decoration: InputDecoration(border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber),
border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber),
), ),
), ),
) )

@ -10,8 +10,7 @@ class SelectCityDialog extends StatefulWidget {
final Function(GetAllCitiesResponseModel) onValueSelected; final Function(GetAllCitiesResponseModel) onValueSelected;
GetAllCitiesResponseModel selectedCity; GetAllCitiesResponseModel selectedCity;
SelectCityDialog( SelectCityDialog({Key key, this.cities, this.onValueSelected, this.selectedCity});
{Key key, this.cities, this.onValueSelected, this.selectedCity});
@override @override
_SelectCityDialogState createState() => _SelectCityDialogState(); _SelectCityDialogState createState() => _SelectCityDialogState();
@ -26,104 +25,109 @@ class _SelectCityDialogState extends State<SelectCityDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SimpleDialog( return Dialog(
children: [ child: Column(
Column( children: [
children: [ Expanded(
Divider(), child: SingleChildScrollView(
...List.generate( child: Column(
widget.cities.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( ...List.generate(
height: 2, widget.cities.length,
), (index) => Column(
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Expanded( SizedBox(
flex: 1, height: 2,
child: InkWell(
onTap: () {
setState(() {
widget.selectedCity = widget.cities[index];
});
},
child: ListTile(
title: Text(widget.cities[index].description),
leading: Radio(
value: widget.cities[index],
groupValue: widget.selectedCity,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedCity = value;
});
},
),
),
), ),
) Row(
], children: <Widget>[
), Expanded(
SizedBox( flex: 1,
height: 5.0, child: InkWell(
onTap: () {
setState(() {
widget.selectedCity = widget.cities[index];
});
},
child: ListTile(
title: Text(widget.cities[index].description),
leading: Radio(
value: widget.cities[index],
groupValue: widget.selectedCity,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedCity = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
), ),
], ],
), ),
), ),
SizedBox( ),
height: 5.0, SizedBox(
), height: 5.0,
Row( ),
// mainAxisAlignment: MainAxisAlignment.spaceBetween, Row(
children: <Widget>[ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expanded( children: <Widget>[
flex: 1, Expanded(
child: InkWell( flex: 1,
onTap: () { child: InkWell(
Navigator.pop(context); onTap: () {
}, Navigator.pop(context);
child: Padding( },
padding: const EdgeInsets.all(8.0), child: Padding(
child: Container( padding: const EdgeInsets.all(8.0),
child: Center( child: Container(
child: Texts( child: Center(
TranslationBase.of(context).cancel.toUpperCase(), child: Texts(
color: Colors.red, TranslationBase.of(context).cancel.toUpperCase(),
), color: Colors.red,
), ),
), ),
), ),
), ),
), ),
Container( ),
width: 1, Container(
height: 30, width: 1,
color: Colors.grey[500], height: 30,
), color: Colors.grey[500],
Expanded( ),
flex: 1, Expanded(
child: InkWell( flex: 1,
onTap: () { child: InkWell(
widget.onValueSelected(widget.selectedCity); onTap: () {
Navigator.pop(context); widget.onValueSelected(widget.selectedCity);
}, Navigator.pop(context);
child: Padding( },
padding: const EdgeInsets.all(8.0), child: Padding(
child: Center( padding: const EdgeInsets.all(8.0),
child: Texts( child: Center(
TranslationBase.of(context).ok, child: Texts(
fontWeight: FontWeight.w400, TranslationBase.of(context).ok,
)), fontWeight: FontWeight.w400,
), )),
), ),
), ),
], ),
) ],
], )
) ],
], ),
); );
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -7,14 +8,15 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class SelectSearchCriteriaDialog extends StatefulWidget { class SelectSearchCriteriaDialog extends StatefulWidget {
List<SearchCriteriaModel> searchCriteria = [ List<SearchCriteriaModel> searchCriteria = [
SearchCriteriaModel(name: "Identification Number",nameAr:"رقم المحول",value: 1), SearchCriteriaModel(name: "Identification Number",nameAr:"رقم الهوية",value: 1),
SearchCriteriaModel(name: "Referral Number",nameAr:"رقم المحول",value: 2), SearchCriteriaModel(name: "Referral Number",nameAr:"رقم الإحالة",value: 2),
]; ];
final Function(SearchCriteriaModel) onValueSelected; final Function(SearchCriteriaModel) onValueSelected;
SearchCriteriaModel selectedCriteria; SearchCriteriaModel selectedCriteria;
ProjectViewModel projectViewModel;
SelectSearchCriteriaDialog( SelectSearchCriteriaDialog(
{Key key, this.onValueSelected, this.selectedCriteria}); {Key key, this.onValueSelected, this.selectedCriteria, this.projectViewModel});
@override @override
_SelectSearchCriteriaDialogState createState() => _SelectSearchCriteriaDialogState(); _SelectSearchCriteriaDialogState createState() => _SelectSearchCriteriaDialogState();
@ -33,7 +35,7 @@ class _SelectSearchCriteriaDialogState extends State<SelectSearchCriteriaDialog>
children: [ children: [
Column( Column(
children: [ children: [
Texts(" Select Search Criteria", fontSize: 20,), Text(TranslationBase.of(context).searchCriteria),
Divider(), Divider(),
...List.generate( ...List.generate(
widget.searchCriteria.length, widget.searchCriteria.length,
@ -54,7 +56,7 @@ class _SelectSearchCriteriaDialogState extends State<SelectSearchCriteriaDialog>
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.searchCriteria[index].name), title: Text(widget.projectViewModel.isArabic ? widget.searchCriteria[index].nameAr : widget.searchCriteria[index].name),
leading: Radio( leading: Radio(
value: widget.searchCriteria[index], value: widget.searchCriteria[index],
groupValue: widget.selectedCriteria, groupValue: widget.selectedCriteria,

@ -84,6 +84,7 @@ class _EReferralPageState extends State<EReferralPage>
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
StartIndexForNewEReferral(), StartIndexForNewEReferral(),

@ -30,7 +30,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
Container( Container(
width: double.infinity, width: double.infinity,
child: Card( child: Card(
elevation: 3.0, elevation: 0.0,
shape: cardRadius(12), shape: cardRadius(12),
margin: margin:
EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
@ -42,7 +42,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
Container( Container(
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
child: Text( child: Text(
TranslationBase.of(context).referralDetails, TranslationBase.of(context).ereferral,
style: TextStyle( style: TextStyle(
letterSpacing: -0.64, letterSpacing: -0.64,
color: Colors.black, color: Colors.black,
@ -116,7 +116,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
), ),
Expanded( Expanded(
child: _getNormalText( child: _getNormalText(
DateUtil.getMonthDayYearDateFormatted( DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDateNoTimeZone( DateUtil.convertStringToDateNoTimeZone(
widget.referral.referralDate)), widget.referral.referralDate)),
isBold: true), isBold: true),

@ -5,16 +5,14 @@ import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/referral_details.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/referral_details.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -22,7 +20,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'New_E_Referral/new_e_referral_step_one_page.dart';
import 'dialogs/select_country_ingo_Dialog.dart'; import 'dialogs/select_country_ingo_Dialog.dart';
import 'dialogs/select_search_criteria_dialog.dart'; import 'dialogs/select_search_criteria_dialog.dart';
@ -36,12 +33,12 @@ class SearchForReferralsPage extends StatefulWidget {
class _SearchForReferralsPageState extends State<SearchForReferralsPage> { class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
TextEditingController _searchTextController = TextEditingController(); TextEditingController _searchTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController(); String mobileNo = "";
bool _isSubmitted = false; bool _isSubmitted = false;
dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
SearchCriteriaModel selectedCriteria = SearchCriteriaModel(name: "Identification Number", nameAr: "رقم المحول", value: 1); SearchCriteriaModel selectedCriteria = SearchCriteriaModel(name: "Identification Number", nameAr: "رقم الهوية", value: 1);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -80,55 +77,106 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
InkWell( // InkWell(
onTap: () => selectSearchCriteriaDialog(), // onTap: () => selectSearchCriteriaDialog(),
child: Container( // child: Container(
padding: EdgeInsets.all(12), // padding: EdgeInsets.all(12),
width: double.infinity, // width: double.infinity,
height: 65, // height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), // decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], // children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)],
// ),
// ),
// ),
Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
), ),
), ),
), child: InkWell(
SizedBox( onTap: () => selectSearchCriteriaDialog(projectViewModel),
height: 12,
),
NewTextFields(
hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number",
controller: _searchTextController,
onChanged: (_) {
setState(() {});
},
),
SizedBox(
height: 12,
),
InkWell(
onTap: () => confirmSelectCountryTypeDialog(),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectSearchCriteria,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getSearchCriteriaName(projectViewModel),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
],
), ),
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
MobileNumberTextFiled(
controller: _mobileTextController, inputWidget(selectedCriteria.value == 1 ? TranslationBase.of(context).enterIdentificationNumber : TranslationBase.of(context).referralNumber, "", _searchTextController, isInputTypeNum: true),
onChange: (_) {
setState(() {}); SizedBox(
}, height: 12,
code: _selectedCountry == null ? "11" : _selectedCountry["code"],
), ),
PhoneNumberSelectorWidget(onNumberChange: (value) {
setState(() {
mobileNo = value;
});
}, onCountryChange: (value) {
setState(() {
_selectedCountry = value;
});
}),
// InkWell(
// onTap: () => confirmSelectCountryTypeDialog(),
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// MobileNumberTextFiled(
// controller: _mobileTextController,
// onChange: (_) {
// setState(() {});
// },
// code: _selectedCountry == null ? "11" : _selectedCountry["code"],
// ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -155,8 +203,8 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
); );
}, },
child: Card( child: Card(
elevation: 0.0,
shape: cardRadius(12), shape: cardRadius(12),
margin: EdgeInsets.all(10),
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: Row( child: Row(
@ -172,7 +220,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
child: myRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName, projectViewModel.isArabic)), child: myRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName, projectViewModel.isArabic)),
myRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName, projectViewModel.isArabic), myRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName, projectViewModel.isArabic),
myRichText(TranslationBase.of(context).referralDate + ": ", myRichText(TranslationBase.of(context).referralDate + ": ",
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate)), projectViewModel.isArabic), DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate)), projectViewModel.isArabic),
], ],
), ),
Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined), Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined),
@ -200,11 +248,11 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(14), padding: EdgeInsets.all(14),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).search, TranslationBase.of(context).search,
(_searchTextController.text.isEmpty || _mobileTextController.text.isEmpty) (_searchTextController.text.isEmpty || mobileNo.isEmpty)
? null ? null
: () async { : () async {
SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel( SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
patientMobileNumber: _selectedCountry['code'] + _mobileTextController.text, patientMobileNumber: _selectedCountry['code'] + mobileNo,
); );
if (selectedCriteria.value == 1) { if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo = _searchTextController.text; searchEReferralRequestModel.identificationNo = _searchTextController.text;
@ -244,11 +292,12 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
return "Country"; return "Country";
} }
void selectSearchCriteriaDialog() { void selectSearchCriteriaDialog(ProjectViewModel projectViewModel) {
showDialog( showDialog(
context: context, context: context,
child: SelectSearchCriteriaDialog( child: SelectSearchCriteriaDialog(
selectedCriteria: selectedCriteria, selectedCriteria: selectedCriteria,
projectViewModel: projectViewModel,
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {
selectedCriteria = value; selectedCriteria = value;
@ -258,7 +307,80 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
); );
} }
String getSearchCriteriaName() { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
return selectedCriteria.name; {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
}
String getSearchCriteriaName(ProjectViewModel projectViewModel) {
return projectViewModel.isArabic ? selectedCriteria.nameAr : selectedCriteria.name;
} }
} }

@ -8,8 +8,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -26,6 +25,28 @@ class OrdersLogDetailsPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
model.setState(ViewState.Busy);
await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders();
// await model.getHHCAllServices();
}
},
),
);
return;
// todo 'sikander' remove useless code
showDialog( showDialog(
context: context, context: context,
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(
@ -49,128 +70,130 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: ListView.separated( body: model.hhcAllPresOrders.length > 0
padding: EdgeInsets.all(21), ? ListView.separated(
physics: BouncingScrollPhysics(), padding: EdgeInsets.all(21),
itemBuilder: (context, index) { physics: BouncingScrollPhysics(),
GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index]; itemBuilder: (context, index) {
GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index];
int status = order.status; int status = order.status;
String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description; String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
Color _color; Color _color;
if (status == 1) { if (status == 1) {
//pending //pending
_color = Color(0xffCC9B14); _color = Color(0xffCC9B14);
} else if (status == 2) { } else if (status == 2) {
//processing //processing
_color = Color(0xff2E303A); _color = Color(0xff2E303A);
} else if (status == 3) { } else if (status == 3) {
//completed //completed
_color = Color(0xff359846); _color = Color(0xff359846);
} else if (status == 4) { } else if (status == 4) {
//cancel // Rejected //cancel // Rejected
_color = Color(0xffD02127); _color = Color(0xffD02127);
} }
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: _color, color: _color,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
blurRadius: 27, blurRadius: 27,
offset: Offset(0, -3), offset: Offset(0, -3),
), ),
], ],
),
child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
), ),
), child: Container(
// clipBehavior: Clip.antiAlias, // decoration: containerColorRadiusLeft(Colors.white, 12),
child: Row( margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
children: [ decoration: BoxDecoration(
Expanded( color: Colors.white,
child: Column( border: Border.all(color: Colors.white, width: 1),
mainAxisAlignment: MainAxisAlignment.start, borderRadius: BorderRadius.only(
crossAxisAlignment: CrossAxisAlignment.start, bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
children: [ topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
Text( bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
_statusDisp, topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10), ),
), ),
SizedBox(height: 6), // clipBehavior: Clip.antiAlias,
Text( child: Row(
'${TranslationBase.of(context).requestID}: ${order.iD}', crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), children: [
), Expanded(
Row( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).hospital + ": ", _statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
), ),
Expanded( SizedBox(height: 6),
child: Text( Text(
!projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), '${TranslationBase.of(context).requestID}: ${order.iD}',
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
), ),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).hospital + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
!projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
),
],
)
], ],
) ),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 12), Column(
if (order.status == 1 || order.status == 2) mainAxisAlignment: MainAxisAlignment.spaceBetween,
InkWell( crossAxisAlignment: CrossAxisAlignment.end,
onTap: () { children: [
showConfirmMessage(model, order); Text(
}, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
child: Container( style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
), ),
), SizedBox(height: 12),
if (order.status == 1 || order.status == 2)
InkWell(
onTap: () {
showConfirmMessage(model, order);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
],
),
], ],
), ),
], ),
), );
), },
); separatorBuilder: (context, index) => SizedBox(height: 12),
}, itemCount: model.hhcAllPresOrders.length)
separatorBuilder: (context, index) => SizedBox(height: 12), : getNoDataWidget(context),
itemCount: model.hhcAllPresOrders.length),
); );
} }
} }

@ -244,10 +244,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
imageLocation: 'assets/images/emergency_service_image.png', imageLocation: 'assets/images/emergency_service_image.png',
title: TranslationBase.of(context).emergencyService, title: TranslationBase.of(context).emergencyService,
), ),
ServicesContainer( ServicesContainer(onTap: () => getPharmacyToken(), imageLocation: 'assets/images/pharmacy_logo.png', title: TranslationBase.of(context).pharmacy),
onTap: () => getPharmacyToken(),
imageLocation: 'assets/images/pharmacy_logo.png',
title: TranslationBase.of(context).pharmacy),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -332,9 +329,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(page: SmartWatchInstructions()),
page: SmartWatchInstructions()
),
), ),
imageLocation: 'assets/images/new-design/smartwatch_icon.png', imageLocation: 'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches, title: TranslationBase.of(context).smartWatches,

@ -4,101 +4,101 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
// ignore: must_be_immutable // ignore: must_be_immutable
class ConfirmAddAmountDialog extends StatefulWidget { // class ConfirmAddAmountDialog extends StatefulWidget {
final int amount; // final int amount;
final String unit; // final String unit;
final H2OViewModel model; // final H2OViewModel model;
//
ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"}); // ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"});
//
@override // @override
_ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); // _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState();
} // }
//
class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> { // class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return SimpleDialog( // return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0), // contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0),
titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0), // titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0),
title: Center( // title: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).confirm, // TranslationBase.of(context).confirm,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
color: Colors.black, // color: Colors.black,
), // ),
), // ),
children: [ // children: [
Column( // Column(
children: [ // children: [
Divider(), // Divider(),
Center( // Center(
child: Texts( // child: Texts(
"${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?", // "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?",
textAlign: TextAlign.center, // textAlign: TextAlign.center,
color: Colors.grey, // color: Colors.grey,
), // ),
), // ),
SizedBox( // SizedBox(
height: 16.0, // height: 16.0,
), // ),
Row( // Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).cancel.toUpperCase(), // TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, // color: Colors.red,
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
Container( // Container(
width: 1, // width: 1,
height: 30, // height: 30,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () async { // onTap: () async {
InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount); // InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount);
await widget.model.insertUserActivity(insertUserActivityRequestModel); // await widget.model.insertUserActivity(insertUserActivityRequestModel);
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).ok.toUpperCase(), // TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
)), // )),
), // ),
), // ),
), // ),
], // ],
), // ),
], // ],
) // )
], // ],
); // );
} // }
} // }

@ -4,163 +4,163 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
// ignore: must_be_immutable // ignore: must_be_immutable
class SelectAmountDialog extends StatefulWidget { // class SelectAmountDialog extends StatefulWidget {
final Function(AmountModel) onValueSelected; // final Function(AmountModel) onValueSelected;
AmountModel selectedAmount; // AmountModel selectedAmount;
//
SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount}); // SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount});
//
@override // @override
_SelectAmountDialogState createState() => _SelectAmountDialogState(); // _SelectAmountDialogState createState() => _SelectAmountDialogState();
} // }
//
class _SelectAmountDialogState extends State<SelectAmountDialog> { // class _SelectAmountDialogState extends State<SelectAmountDialog> {
List<AmountModel> searchAmount = [ // List<AmountModel> searchAmount = [
AmountModel(name: "l", nameAr: "لتر", value: 1), // AmountModel(name: "l", nameAr: "لتر", value: 1),
AmountModel(name: "ml", nameAr: "مم لتر", value: 2), // AmountModel(name: "ml", nameAr: "مم لتر", value: 2),
]; // ];
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
widget.selectedAmount = widget.selectedAmount ?? searchAmount[0]; // widget.selectedAmount = widget.selectedAmount ?? searchAmount[0];
getLanguage(); // getLanguage();
} // }
//
String languageID = "en"; // String languageID = "en";
//
void getLanguage() async { // void getLanguage() async {
languageID = await sharedPref.getString(APP_LANGUAGE); // languageID = await sharedPref.getString(APP_LANGUAGE);
setState(() {}); // setState(() {});
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return SimpleDialog( // return SimpleDialog(
children: [ // children: [
Column( // Column(
children: [ // children: [
Texts( // Texts(
TranslationBase.of(context).preferredunit, // TranslationBase.of(context).preferredunit,
fontSize: 20, // fontSize: 20,
), // ),
Divider(), // Divider(),
...List.generate( // ...List.generate(
searchAmount.length, // searchAmount.length,
(index) => Column( // (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
SizedBox( // SizedBox(
height: 2, // height: 2,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
setState(() { // setState(() {
widget.selectedAmount = searchAmount[index]; // widget.selectedAmount = searchAmount[index];
}); // });
}, // },
child: ListTile( // child: ListTile(
title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name), // title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name),
leading: Radio( // leading: Radio(
value: searchAmount[index], // value: searchAmount[index],
groupValue: widget.selectedAmount, // groupValue: widget.selectedAmount,
activeColor: Colors.red[800], // activeColor: Colors.red[800],
onChanged: (value) { // onChanged: (value) {
setState(() { // setState(() {
widget.selectedAmount = value; // widget.selectedAmount = value;
}); // });
}, // },
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).cancel.toUpperCase(), // TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, // color: Colors.red,
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
Container( // Container(
width: 1, // width: 1,
height: 30, // height: 30,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
widget.onValueSelected(widget.selectedAmount); // widget.onValueSelected(widget.selectedAmount);
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).ok, // TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
)), // )),
), // ),
), // ),
), // ),
], // ],
) // )
], // ],
) // )
], // ],
); // );
} // }
} // }
//
class AmountModel { // class AmountModel {
String name; // String name;
String nameAr; // String nameAr;
int value; // int value;
//
AmountModel({this.name, this.nameAr, this.value}); // AmountModel({this.name, this.nameAr, this.value});
//
AmountModel.fromJson(Map<String, dynamic> json) { // AmountModel.fromJson(Map<String, dynamic> json) {
name = json['name']; // name = json['name'];
nameAr = json['nameAr']; // nameAr = json['nameAr'];
value = json['value']; // value = json['value'];
} // }
//
Map<String, dynamic> toJson() { // Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); // final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name; // data['name'] = this.name;
data['nameAr'] = this.nameAr; // data['nameAr'] = this.nameAr;
data['value'] = this.value; // data['value'] = this.value;
return data; // return data;
} // }
} // }

@ -10,123 +10,124 @@ import 'package:flutter/material.dart';
import 'Dialog/select_amount_dialog.dart'; import 'Dialog/select_amount_dialog.dart';
class AddCustomAmount extends StatefulWidget { // todo 'sikander' remove useless code
final H2OViewModel model; // class AddCustomAmount extends StatefulWidget {
final Function changePageViewIndex; // final H2OViewModel model;
// final Function changePageViewIndex;
const AddCustomAmount({Key key, this.model, this.changePageViewIndex}) //
: super(key: key); // const AddCustomAmount({Key key, this.model, this.changePageViewIndex})
// : super(key: key);
@override //
_AddCustomAmountState createState() => _AddCustomAmountState(); // @override
} // _AddCustomAmountState createState() => _AddCustomAmountState();
// }
class _AddCustomAmountState extends State<AddCustomAmount> { //
TextEditingController _nameTextController = TextEditingController(); // class _AddCustomAmountState extends State<AddCustomAmount> {
AmountModel selectedAmount; // TextEditingController _nameTextController = TextEditingController();
// AmountModel selectedAmount;
@override //
void initState() { // @override
setState(() { // void initState() {
_nameTextController.text = "0"; // setState(() {
}); // _nameTextController.text = "0";
super.initState(); // });
} // super.initState();
// }
@override //
Widget build(BuildContext context) { // @override
return AppScaffold( // Widget build(BuildContext context) {
isShowAppBar: true, // return AppScaffold(
appBarTitle:TranslationBase.of(context).customLabel, // isShowAppBar: true,
body: SingleChildScrollView( // appBarTitle:TranslationBase.of(context).customLabel,
physics: ScrollPhysics(), // body: SingleChildScrollView(
child: Container( // physics: ScrollPhysics(),
margin: EdgeInsets.all(12), // child: Container(
child: Center( // margin: EdgeInsets.all(12),
child: FractionallySizedBox( // child: Center(
widthFactor: 0.94, // child: FractionallySizedBox(
child: Column( // widthFactor: 0.94,
crossAxisAlignment: CrossAxisAlignment.start, // child: Column(
children: [ // crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( // children: [
height: 12, // SizedBox(
), // height: 12,
NewTextFields( // ),
hintText: TranslationBase.of(context).h2oAmountOfWater, // NewTextFields(
// type: "Number", // hintText: TranslationBase.of(context).h2oAmountOfWater,
controller: _nameTextController, // // type: "Number",
), // controller: _nameTextController,
SizedBox( // ),
height: 12, // SizedBox(
), // height: 12,
InkWell( // ),
onTap: () => confirmAmountTypeDialog(), // InkWell(
child: Container( // onTap: () => confirmAmountTypeDialog(),
padding: EdgeInsets.all(12), // child: Container(
width: double.infinity, // padding: EdgeInsets.all(12),
height: 65, // width: double.infinity,
decoration: BoxDecoration( // height: 65,
borderRadius: BorderRadius.circular(12), // decoration: BoxDecoration(
color: Colors.white), // borderRadius: BorderRadius.circular(12),
child: Row( // color: Colors.white),
mainAxisAlignment: MainAxisAlignment.spaceBetween, // child: Row(
children: [ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
Texts(getAmountName()), // children: [
Icon(Icons.arrow_drop_down) // Texts(getAmountName()),
], // Icon(Icons.arrow_drop_down)
), // ],
), // ),
), // ),
SizedBox( // ),
height: 12, // SizedBox(
), // height: 12,
SecondaryButton( // ),
textColor: Colors.white, // SecondaryButton(
label: TranslationBase.of(context).ok, // textColor: Colors.white,
onTap: () async { // label: TranslationBase.of(context).ok,
Navigator.of(context).pop(); // onTap: () async {
showConfirmMessage (int.parse(_nameTextController.text), widget.model); // Navigator.of(context).pop();
}, // showConfirmMessage (int.parse(_nameTextController.text), widget.model);
// loading: model.state == ViewState.BusyLocal, // },
disabled: _nameTextController.text.isEmpty || selectedAmount == null), // // loading: model.state == ViewState.BusyLocal,
SizedBox( // disabled: _nameTextController.text.isEmpty || selectedAmount == null),
height: 12, // SizedBox(
), // height: 12,
], // ),
), // ],
), // ),
), // ),
), // ),
), // ),
); // ),
} // );
// }
//
void confirmAmountTypeDialog() { //
showDialog( // void confirmAmountTypeDialog() {
context: context, // showDialog(
child: SelectAmountDialog( // context: context,
selectedAmount: selectedAmount, // child: SelectAmountDialog(
onValueSelected: (value) { // selectedAmount: selectedAmount,
setState(() { // onValueSelected: (value) {
selectedAmount = value; // setState(() {
}); // selectedAmount = value;
}, // });
), // },
); // ),
} // );
// }
//
String getAmountName() { //
if (selectedAmount != null) // String getAmountName() {
return selectedAmount.name; // if (selectedAmount != null)
else // return selectedAmount.name;
return TranslationBase.of(context).selectUnit; // else
} // return TranslationBase.of(context).selectUnit;
// }
//
//
void showConfirmMessage(int amount, H2OViewModel model) { //
showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); // void showConfirmMessage(int amount, H2OViewModel model) {
} // showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,));
} // }
// }

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart';
@ -14,7 +15,6 @@ import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -77,132 +77,70 @@ class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
}, },
), ),
], ],
body: Scaffold( body: Column(
// extendBodyBehindAppBar: true, children: <Widget>[
// appBar: PreferredSize( TabBar(
// preferredSize: Size.fromHeight(65.0), controller: _tabController,
// child: Stack( indicatorWeight: 3.0,
// children: <Widget>[ indicatorSize: TabBarIndicatorSize.tab,
// Positioned( labelColor: Color(0xff2B353E),
// bottom: 1, unselectedLabelColor: Color(0xff575757),
// left: 0, labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
// right: 0, labelStyle: TextStyle(
// child: BackdropFilter( fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
// filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), fontSize: 16,
// child: Container( fontWeight: FontWeight.w600,
// color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), letterSpacing: -0.48,
// height: 70.0, ),
// ), unselectedLabelStyle: TextStyle(
// ), fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
// ), fontSize: 16,
// Center( fontWeight: FontWeight.w600,
// child: Container( letterSpacing: -0.48,
// height: 60.0, ),
// alignment: Alignment.center, tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)],
// // margin: EdgeInsets.only(top: 10.0), ),
// // width: MediaQuery.of(context).size.width * 0.9, Expanded(
// child: TabBarView(
// child: TabBar( physics: BouncingScrollPhysics(),
// isScrollable: false,
// controller: _tabController,
// indicatorWeight: 5.0,
// indicatorSize: TabBarIndicatorSize.tab,
// indicatorColor: Colors.red[800],
// labelColor: Theme.of(context).primaryColor,
// labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
// unselectedLabelColor: Colors.grey[800],
// tabs: [
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).today),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).week),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).month),
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// backgroundColor: Colors.white,
body: Column(
children: <Widget>[
TabBar(
controller: _tabController, controller: _tabController,
indicatorWeight: 3.0, children: <Widget>[TodayPage(), WeekPage(), MonthPage()],
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)],
), ),
Expanded( )
child: TabBarView( ],
physics: BouncingScrollPhysics(), ),
controller: _tabController, bottomNavigationBar: BottomNavBar(
children: <Widget>[TodayPage(), WeekPage(), MonthPage()], changeIndex: (index) {
), if (index == 0) {
) IS_VOICE_COMMAND_CLOSED = false;
], } else if (index == 1) {
), Navigator.push(
bottomNavigationBar: BottomNavBar( context,
changeIndex: (index) { FadePage(
if (index == 0) { page: AppScaffold(
IS_VOICE_COMMAND_CLOSED = false; appBarTitle: TranslationBase.of(context).medicalProfile,
} else if (index == 1) { isShowAppBar: true,
Navigator.push( showHomeAppBarIcon: false,
context, appBarIcons: [
FadePage( IconButton(
page: AppScaffold( icon: Image.asset("assets/images/new-design/setting_gear_icon.png"),
appBarTitle: TranslationBase.of(context).medicalProfile, color: Colors.white,
isShowAppBar: true, onPressed: () => Navigator.of(context).pushNamed(
showHomeAppBarIcon: false, SETTINGS,
appBarIcons: [
IconButton(
icon: Image.asset("assets/images/new-design/setting_gear_icon.png"),
color: Colors.white,
onPressed: () => Navigator.of(context).pushNamed(
SETTINGS,
),
), ),
], ),
body: MedicalProfilePageNew()))); ],
} else if (index == 2) { body: MedicalProfilePageNew())));
Navigator.of(context).pushNamedAndRemoveUntil(HOME, (Route<dynamic> route) => false); } else if (index == 2) {
} else if (index == 3) { Navigator.of(context).pushNamedAndRemoveUntil(HOME, (Route<dynamic> route) => false);
Navigator.of(context).pushNamed(MY_FAMILIY); } else if (index == 3) {
} else if (index == 4) { Navigator.of(context).pushNamed(MY_FAMILIY);
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: false))); } else if (index == 4) {
} Navigator.push(context, FadePage(page: ToDo(isShowAppBar: false)));
}, }
showHomeIcon: true, },
index: 0, showHomeIcon: true,
), index: 0,
), ),
), ),
); );

@ -6,10 +6,11 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/charts/custom_line_chart.dart';
class MonthPage extends StatelessWidget { class MonthPage extends StatelessWidget {
@override @override
@ -21,37 +22,39 @@ class MonthPage extends StatelessWidget {
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).h2o, appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model, baseViewModel: model,
body: Padding( body: SingleChildScrollView(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(21),
child: ListView( physics: BouncingScrollPhysics(),
children: [ child: (model.userProgressForMonthDataSeries ?? []).isEmpty
Center( ? getNoDataWidget(context)
child: Text( : Container(
TranslationBase.of(context).waterConsumedInMonth, padding: EdgeInsets.fromLTRB(16, 14, 16, 14),
textAlign: TextAlign.center, decoration: BoxDecoration(
style: TextStyle(fontSize: 20.0, color: Colors.black87), color: Colors.white,
), borderRadius: BorderRadius.all(
), Radius.circular(10.0),
SizedBox(height: 16), ),
Row( boxShadow: [
mainAxisAlignment: MainAxisAlignment.center, BoxShadow(
children: [ color: Color(0xff000000).withOpacity(.05),
Container( blurRadius: 27,
height: 10, offset: Offset(0, -3),
width: 40, ),
color: Colors.blue, ],
), ),
SizedBox(width: 8), child: Column(
Text( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).waterConsumedInMonth, mainAxisSize: MainAxisSize.min,
style: TextStyle(fontSize: 12.0), children: [
Text(
TranslationBase.of(context).waterConsumedInMonth,
style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64),
),
SizedBox(height: 24),
CustomLineChart(model.userProgressForMonthDataSeries, projectViewModel.isArabic),
],
), ),
], ),
),
// SizedBox(height: 8),
AppBarChart(seriesList: model.userProgressForMonthDataSeries, isArabic: projectViewModel.isArabic),
],
),
), ),
), ),
); );

@ -302,25 +302,11 @@ class _TodayPageState extends State<TodayPage> {
); );
} }
Widget _circularButton(context, int value, model, {bool isCustom = false}) { Widget _circularButton(context, int value, model) {
String _text = "$value${TranslationBase.of(context).ml}"; String _text = "$value${TranslationBase.of(context).ml}";
if (isCustom) {
_text = TranslationBase.of(context).custom;
}
return InkWell( return InkWell(
onTap: () { onTap: () {
if (isCustom) { showConfirmMessage(context, value, model);
Navigator.push(
context,
FadePage(
page: AddCustomAmount(
model: model,
),
),
);
} else {
showConfirmMessage(context, value, model);
}
}, },
child: Container( child: Container(
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),

@ -1,12 +1,10 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/charts/custom_line_chart.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -21,37 +19,39 @@ class WeekPage extends StatelessWidget {
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).h2o, appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model, baseViewModel: model,
body: Padding( body: SingleChildScrollView(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(21),
child: ListView( physics: BouncingScrollPhysics(),
children: [ child: (model.userProgressForWeekDataSeries ?? []).isEmpty
Center( ? getNoDataWidget(context)
child: Text( : Container(
TranslationBase.of(context).waterConsumedInWeek, padding: EdgeInsets.fromLTRB(16, 14, 16, 14),
textAlign: TextAlign.center, decoration: BoxDecoration(
style: TextStyle(fontSize: 20.0, color: Colors.black87), color: Colors.white,
), borderRadius: BorderRadius.all(
), Radius.circular(10.0),
SizedBox(height: 16), ),
Row( boxShadow: [
mainAxisAlignment: MainAxisAlignment.center, BoxShadow(
children: [ color: Color(0xff000000).withOpacity(.05),
Container( blurRadius: 27,
height: 10, offset: Offset(0, -3),
width: 40, ),
color: Colors.blue, ],
), ),
SizedBox(width: 8), child: Column(
Text( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).waterConsumedInWeek, mainAxisSize: MainAxisSize.min,
style: TextStyle(fontSize: 12.0), children: [
Text(
TranslationBase.of(context).waterConsumedInWeek,
style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64),
),
SizedBox(height: 24),
CustomLineChart(model.userProgressForWeekDataSeries, projectViewModel.isArabic),
],
), ),
], ),
),
// SizedBox(height: 8),
AppBarChart(seriesList: model.userProgressForWeekDataSeries,isArabic: projectViewModel.isArabic),
],
),
), ),
), ),
); );

@ -9,189 +9,193 @@ import 'package:flutter/material.dart';
import '../add_custom_amount.dart'; import '../add_custom_amount.dart';
class H20FloatingActionButton extends StatefulWidget {
const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key);
final H2OViewModel model; // todo 'sikander' remove useless code
@override
_H20FloatingActionButtonState createState() => _H20FloatingActionButtonState();
}
class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin { // class H20FloatingActionButton extends StatefulWidget {
AnimationController _controller; // const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key);
@override //
void initState() { // final H2OViewModel model;
_controller = new AnimationController( //
vsync: this, // @override
duration: const Duration(milliseconds: 500), // _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState();
); // }
super.initState(); //
} // class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
// AnimationController _controller;
void showConfirmMessage(int amount, H2OViewModel model) { // @override
showDialog( // void initState() {
context: context, // _controller = new AnimationController(
child: ConfirmAddAmountDialog( // vsync: this,
model: model, // duration: const Duration(milliseconds: 500),
amount: amount, // );
), // super.initState();
); // }
} //
// void showConfirmMessage(int amount, H2OViewModel model) {
@override // showDialog(
Widget build(BuildContext context) { // context: context,
return Container( // child: ConfirmAddAmountDialog(
margin: EdgeInsets.only(left: 20, right: 20), // model: model,
child: new Column(mainAxisSize: MainAxisSize.min, children: [ // amount: amount,
Row( // ),
mainAxisAlignment: MainAxisAlignment.start, // );
children: [ // }
Column( //
crossAxisAlignment: CrossAxisAlignment.end, // @override
children: [ // Widget build(BuildContext context) {
ActionButton( // return Container(
controller: _controller, // margin: EdgeInsets.only(left: 20, right: 20),
text: "600${TranslationBase.of(context).ml}", // child: new Column(mainAxisSize: MainAxisSize.min, children: [
onTap: () { // Row(
showConfirmMessage(600, widget.model); // mainAxisAlignment: MainAxisAlignment.start,
}, // children: [
), // Column(
ActionButton( // crossAxisAlignment: CrossAxisAlignment.end,
controller: _controller, // children: [
text: "330${TranslationBase.of(context).ml}", // ActionButton(
onTap: () { // controller: _controller,
showConfirmMessage(330, widget.model); // text: "600${TranslationBase.of(context).ml}",
}, // onTap: () {
), // showConfirmMessage(600, widget.model);
ActionButton( // },
controller: _controller, // ),
text: "200${TranslationBase.of(context).ml}", // ActionButton(
onTap: () { // controller: _controller,
showConfirmMessage(200, widget.model); // text: "330${TranslationBase.of(context).ml}",
}, // onTap: () {
), // showConfirmMessage(330, widget.model);
], // },
), // ),
], // ActionButton(
), // controller: _controller,
Row( // text: "200${TranslationBase.of(context).ml}",
mainAxisAlignment: MainAxisAlignment.start, // onTap: () {
children: [ // showConfirmMessage(200, widget.model);
FloatingActionButton( // },
heroTag: null, // ),
child: new AnimatedBuilder( // ],
animation: _controller, // ),
builder: (BuildContext context, Widget child) { // ],
return new Transform( // ),
transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi), // Row(
alignment: FractionalOffset.center, // mainAxisAlignment: MainAxisAlignment.start,
child: new Icon(_controller.isDismissed ? Icons.add : Icons.close), // children: [
); // FloatingActionButton(
}, // heroTag: null,
), // child: new AnimatedBuilder(
onPressed: () { // animation: _controller,
if (_controller.isDismissed) { // builder: (BuildContext context, Widget child) {
_controller.forward(); // return new Transform(
} else { // transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi),
_controller.reverse(); // alignment: FractionalOffset.center,
} // child: new Icon(_controller.isDismissed ? Icons.add : Icons.close),
}, // );
), // },
new Container( // ),
margin: EdgeInsets.only(left: 8, bottom: 4), // onPressed: () {
alignment: FractionalOffset.topCenter, // if (_controller.isDismissed) {
child: new ScaleTransition( // _controller.forward();
scale: new CurvedAnimation( // } else {
parent: _controller, // _controller.reverse();
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), // }
), // },
child: new FloatingActionButton( // ),
backgroundColor: Colors.white, // new Container(
heroTag: null, // margin: EdgeInsets.only(left: 8, bottom: 4),
// mini: true, // alignment: FractionalOffset.topCenter,
child: Text( // child: new ScaleTransition(
TranslationBase.of(context).custom, // scale: new CurvedAnimation(
textAlign: TextAlign.center, // parent: _controller,
style: TextStyle(fontSize: 12, color: Colors.grey), // curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
), // ),
onPressed: () { // child: new FloatingActionButton(
Navigator.push( // backgroundColor: Colors.white,
context, // heroTag: null,
FadePage( // // mini: true,
page: AddCustomAmount( // child: Text(
model: widget.model, // TranslationBase.of(context).custom,
), // textAlign: TextAlign.center,
), // style: TextStyle(fontSize: 12, color: Colors.grey),
); // ),
}, // onPressed: () {
), // Navigator.push(
), // context,
), // FadePage(
new Container( // page: AddCustomAmount(
margin: EdgeInsets.only(left: 8, bottom: 4), // model: widget.model,
alignment: FractionalOffset.topCenter, // ),
child: new ScaleTransition( // ),
scale: new CurvedAnimation( // );
parent: _controller, // },
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), // ),
), // ),
child: new FloatingActionButton( // ),
backgroundColor: Colors.white, // new Container(
heroTag: null, // margin: EdgeInsets.only(left: 8, bottom: 4),
//mini: true, // alignment: FractionalOffset.topCenter,
child: Text( // child: new ScaleTransition(
TranslationBase.of(context).undo, // scale: new CurvedAnimation(
textAlign: TextAlign.center, // parent: _controller,
style: TextStyle(fontSize: 12.0, color: Colors.grey), // curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
), // ),
onPressed: undoVolume, // child: new FloatingActionButton(
), // backgroundColor: Colors.white,
), // heroTag: null,
), // //mini: true,
], // child: Text(
), // TranslationBase.of(context).undo,
]), // textAlign: TextAlign.center,
); // style: TextStyle(fontSize: 12.0, color: Colors.grey),
} // ),
// onPressed: undoVolume,
void undoVolume() async { // ),
GifLoaderDialogUtils.showMyDialog(context); // ),
await widget.model.undoUserActivity(); // ),
GifLoaderDialogUtils.hideDialog(context); // ],
} // ),
} // ]),
// );
class ActionButton extends StatelessWidget { // }
const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap}) //
: _controller = controller, // void undoVolume() async {
super(key: key); // GifLoaderDialogUtils.showMyDialog(context);
// await widget.model.undoUserActivity();
final AnimationController _controller; // GifLoaderDialogUtils.hideDialog(context);
final String text; // }
final Function onTap; // }
//
@override // class ActionButton extends StatelessWidget {
Widget build(BuildContext context) { // const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap})
return Container( // : _controller = controller,
margin: EdgeInsets.only(left: 4, bottom: 8), // super(key: key);
alignment: FractionalOffset.topCenter, //
child: new ScaleTransition( // final AnimationController _controller;
scale: new CurvedAnimation( // final String text;
parent: _controller, // final Function onTap;
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), //
), // @override
child: new FloatingActionButton( // Widget build(BuildContext context) {
heroTag: null, // return Container(
backgroundColor: Colors.white, // margin: EdgeInsets.only(left: 4, bottom: 8),
//mini: true, // alignment: FractionalOffset.topCenter,
child: Text( // child: new ScaleTransition(
text, // scale: new CurvedAnimation(
textAlign: TextAlign.center, // parent: _controller,
style: TextStyle(fontSize: 12.0, color: Colors.grey), // curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
), // ),
onPressed: onTap), // child: new FloatingActionButton(
), // heroTag: null,
); // backgroundColor: Colors.white,
} // //mini: true,
} // child: Text(
// text,
// textAlign: TextAlign.center,
// style: TextStyle(fontSize: 12.0, color: Colors.grey),
// ),
// onPressed: onTap),
// ),
// );
// }
// }

@ -32,7 +32,7 @@ class ParkingPage extends StatelessWidget {
? Column( ? Column(
children: <Widget>[ children: <Widget>[
Texts( Texts(
TranslationBase.of(context).parkingTitle, TranslationBase.of(context).parkingDescription,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 15, fontSize: 15,
), ),
@ -149,6 +149,7 @@ class ParkingPage extends StatelessWidget {
), ),
bottomSheet: !model.isSavePark bottomSheet: !model.isSavePark
? Container( ? Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.10, height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity, width: double.infinity,
child: Column( child: Column(

@ -96,8 +96,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).bloodDEnterDesc, TranslationBase.of(context).bloodDEnterDesc
textAlign: TextAlign.center,
), ),
SizedBox( SizedBox(
height: 12, height: 12,
@ -240,7 +239,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(20),
child: DefaultButton(TranslationBase.of(context).save, () async { child: DefaultButton(TranslationBase.of(context).save, () async {
if (_selectedHospital == null) { if (_selectedHospital == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);

@ -401,7 +401,7 @@ class _BookConfirmState extends State<BookConfirm> {
widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString(); widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString();
}); });
return widget.appoDateFormatted; return DateUtil.getDayMonthYearDateFormatted(dateObj);
} }
DateTime getDateTime() { DateTime getDateTime() {

@ -175,7 +175,7 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: CustomColors.green,
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
@ -214,55 +214,63 @@ class _BookSuccessState extends State<BookSuccess> {
Widget _getConfirmAppoButtons() { Widget _getConfirmAppoButtons() {
return Container( return Container(
alignment: Alignment.bottomCenter, color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.only(bottom: 5.0), child: Container(
height: MediaQuery.of(context).size.height * 0.15, color: CustomColors.appBackgroudGreyColor,
child: Column( margin: EdgeInsets.all(14),
mainAxisAlignment: MainAxisAlignment.end, height: 45.0,
children: <Widget>[ child: Row(
ButtonTheme( mainAxisAlignment: MainAxisAlignment.end,
shape: RoundedRectangleBorder( children: <Widget>[
borderRadius: BorderRadius.circular(10.0), Expanded(
), flex: 1,
minWidth: MediaQuery.of(context).size.width * 0.7, child: ButtonTheme(
height: 45.0, shape: RoundedRectangleBorder(
child: RaisedButton( borderRadius: BorderRadius.circular(10.0),
color: new Color(0xFF60686b), ),
textColor: Colors.white, height: 45.0,
disabledTextColor: Colors.white, child: RaisedButton(
disabledColor: new Color(0xFFbcc2c4), color: new Color(0xffc5272d),
onPressed: () { textColor: Colors.white,
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); disabledTextColor: Colors.white,
appo.clinicID = widget.docObject.clinicID; disabledColor: new Color(0xFFbcc2c4),
appo.projectID = widget.docObject.projectID; onPressed: () {
appo.appointmentNo = widget.patientShareResponse.appointmentNo; navigateToHome(context);
appo.serviceID = widget.patientShareResponse.serviceID; },
appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; child: Text(TranslationBase.of(context).confirmLater, style: TextStyle(fontSize: 18.0)),
appo.doctorID = widget.patientShareResponse.doctorID; ),
confirmAppointment(appo); ),
},
child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare.toUpperCase() : TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery.of(context).size.width * 0.7, mWidth(7),
height: 45.0, Expanded(
child: RaisedButton( flex: 1,
color: new Color(0xFFc5272d), child: ButtonTheme(
textColor: Colors.white, shape: RoundedRectangleBorder(
disabledTextColor: Colors.white, borderRadius: BorderRadius.circular(10.0),
disabledColor: new Color(0xFFbcc2c4), ),
onPressed: () { height: 45.0,
navigateToHome(context); child: RaisedButton(
}, color: CustomColors.green,
child: Text(TranslationBase.of(context).confirmLater.toUpperCase(), style: TextStyle(fontSize: 18.0)), textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID;
confirmAppointment(appo);
},
child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm,
style: TextStyle(fontSize: 18.0)),
),
),
), ),
), ],
], ),
), ),
); );
} }
@ -365,10 +373,7 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
], ],
), ),
Container( Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), child: getPaymentMethods()),
margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0),
child: Image.asset("assets/images/new-design/payment-method.png"),
),
], ],
); );
} }
@ -447,10 +452,7 @@ class _BookSuccessState extends State<BookSuccess> {
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.36, letterSpacing: -0.36,
)), )),
Container( Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()),
margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0),
child: Image.asset("assets/images/new-design/payment-method.png"),
),
Text( Text(
TranslationBase.of(context).payNowBookSuccesstext2, TranslationBase.of(context).payNowBookSuccesstext2,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
@ -481,11 +483,9 @@ class _BookSuccessState extends State<BookSuccess> {
appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
Navigator.push(context, FadePage(page: PaymentMethod( Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
onSelectedMethod: (String metohd) { setState(() {});
setState(() {}); }))).then((value) {
}
))).then((value) {
if (value != null) { if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
} }

@ -115,6 +115,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
widget.doctor.actualDoctorRate, widget.doctor.actualDoctorRate,
widget.docProfileList.noOfPatientsRate, widget.docProfileList.noOfPatientsRate,
"", "",
decimalDoctorRate: widget.docProfileList.decimalDoctorRate.toString(),
), ),
buttonIcon: 'assets/images/new/Boo_ Appointment.svg', buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -224,7 +225,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Checkbox( Checkbox(
activeColor: new Color(0xFF40ACC9), activeColor: CustomColors.accentColor,
value: nearestAppo, value: nearestAppo,
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {

@ -104,7 +104,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
Row( Row(
children: [ children: [
Text( Text(
TranslationBase.of(context).fileNo + ":", TranslationBase.of(context).nationalIdNumber + ":",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 10, fontSize: 10,

@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class CovidPaymentAlert extends StatefulWidget { class CovidPaymentAlert extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
@ -126,7 +124,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
), ),
mWidth(6), mWidth(6),
_getNormalText( _getNormalText(
widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[0] : "NULL", DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.patientShareResponse.appointmentDate)),
isBold: true, isBold: true,
), ),
], ],
@ -139,7 +137,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
), ),
mWidth(6), mWidth(6),
_getNormalText( _getNormalText(
widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[1] : "NULL", DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientShareResponse.appointmentDate), false),
isBold: true, isBold: true,
), ),
], ],
@ -230,7 +228,6 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
}); });
} }
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(

@ -262,10 +262,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
letterSpacing: -0.46, letterSpacing: -0.46,
), ),
), ),
Container( Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()),
margin: EdgeInsets.only(top: 12, bottom: 12),
child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300),
),
], ],
), ),
), ),

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart'; import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
@ -95,9 +96,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
decoration: containerColorRadiusBorderWidth(CustomColors.accentColor, 200, Colors.white, 4), decoration: containerColorRadiusBorderWidth(CustomColors.accentColor, 200, Colors.white, 4),
), ),
Container( Container(
height: 60.0, height: 100.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)), child: Image.asset(getImagePath(widget.selectedPaymentMethod), width: 100, height: 100),
), ),
mFlex(1), mFlex(1),
InkWell( InkWell(
@ -154,17 +155,16 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
color: Colors.white, color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.1, margin: EdgeInsets.only(bottom: 5.0),
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: DefaultButton(
textColor: Colors.white, TranslationBase.of(context).confirm.toUpperCase(),
color: CustomColors.green, () {
label: TranslationBase.of(context).confirm.toUpperCase(),
onTap: () {
startPaymentProcess(projectViewModel.user); startPaymentProcess(projectViewModel.user);
}, },
color: CustomColors.green,
), ),
), ),
); );
@ -335,25 +335,25 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
String getImagePath(String paymentMethod) { String getImagePath(String paymentMethod) {
switch (paymentMethod) { switch (paymentMethod) {
case "MADA": case "MADA":
return 'assets/images/new-design/mada.png'; return 'assets/images/new/payment/Mada.png';
break;
case "SADAD":
return 'assets/images/new-design/sadad.png';
break; break;
// case "SADAD":
// return 'assets/images/new-design/sadad.png';
// break;
case "VISA": case "VISA":
return 'assets/images/new-design/visa.png'; return 'assets/images/new/payment/visa.png';
break; break;
case "MASTERCARD": case "MASTERCARD":
return 'assets/images/new-design/mastercard.png'; return 'assets/images/new/payment/Mastercard.png';
break; break;
case "Installment": case "Installment":
return 'assets/images/new-design/installment.png'; return 'assets/images/new/payment/installments.png';
break; break;
case "ApplePay": case "ApplePay":
return 'assets/images/new-design/applepay.svg'; return 'assets/images/new/payment/Apple_Pay.png';
break; break;
} }
return 'assets/images/new-design/mada.png'; return 'assets/images/new/payment/Mada.png';
} }
} }

@ -35,6 +35,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:flutter_svg/flutter_svg.dart';
class MyFamily extends StatefulWidget { class MyFamily extends StatefulWidget {
final bool isAppbarVisible; final bool isAppbarVisible;
@ -123,7 +125,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
controller: _tabController, controller: _tabController,
children: [myFamilyDetails(context), myFamilyRequest(context)], children: [myFamilyDetails(context), myFamilyRequest(context)],
) )
: Container(child: AppText('Loading..')), : Container(child: AppText('')),
), ),
], ],
), ),
@ -153,82 +155,108 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) { builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading...'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return ListView.separated( return ListView.separated(
itemBuilder: (context, index) { itemBuilder: (context, index) {
snapshot.data.getAllSharedRecordsByStatusList[index].gender = 2;
if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3) if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3)
return Card( return Card(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
shape: cardRadius(15), shape: cardRadius(25),
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0xff6EA8FF) : Color(0xffFDA4B0), color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0xff6EA8FF) : Color(0xffFDA4B0),
elevation: 3, elevation: 3,
child: Container( child: Container(
// height: 130, // height: 130,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: [
Texts( Column(
snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach, crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 22, children: <Widget>[
fontWeight: FontWeight.bold, Texts(
color: Colors.white, snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white,
),
Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
fontSize: 12, color: Colors.white),
Texts(
snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
' ' +
TranslationBase.of(context).years +
', ' +
snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
fontSize: 12,
color: Colors.white),
],
), ),
Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(), Column(
fontSize: 12, color: Colors.white),
Texts(
snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
' ' +
TranslationBase.of(context).years +
', ' +
snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
fontSize: 12,
color: Colors.white),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( SizedBox(height: 10),
children: [ InkWell(
CupertinoSwitch( onTap: () {
value: isSwitchUser, switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
onChanged: (value) { },
setState(() { child: Container(
isSwitchUser = value; decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
}); padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); child: Row(
}, mainAxisAlignment: MainAxisAlignment.center,
), children: [
Texts( SvgPicture.asset("assets/images/new-design/switch.svg",
TranslationBase.of(context).switchUser, height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E)),
color: Colors.white, SizedBox(
fontSize: 12, width: 5,
) ),
], // CupertinoSwitch(
// value: isSwitchUser,
// onChanged: (value) {
// setState(() {
// isSwitchUser = value;
// });
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
// },
// ),
Texts(TranslationBase.of(context).switchUser,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E),
fontSize: 12,
fontWeight: FontWeight.bold)
],
))),
SizedBox(
height: 10,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context); deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context);
}, },
child: Row( child: Container(
children: [ decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
Texts( padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
TranslationBase.of(context).delete, child: Row(
color: Colors.white, mainAxisAlignment: MainAxisAlignment.center,
fontSize: 12, children: [
), SvgPicture.asset("assets/images/new-design/delete.svg",
Icon( height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E)),
Icons.delete, SizedBox(
color: Colors.white, width: 5,
), ),
], Texts(TranslationBase.of(context).delete,
)) color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E),
fontSize: 12,
fontWeight: FontWeight.bold),
],
))),
SizedBox(height: 10),
], ],
) ),
], ],
))); )));
else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0) else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0)
@ -261,180 +289,328 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
RoundedContainer( FractionallySizedBox(
child: ExpansionTile( widthFactor: 1.0,
title: Text( child: AppExpandableNotifier(
TranslationBase.of(context).userViewRequest, title: TranslationBase.of(context).userViewRequest,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), bodyWidget: FutureBuilder(
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) { builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); return SizedBox();
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return Container( return ListView.separated(
padding: EdgeInsets.all(15), shrinkWrap: true,
child: Card( physics: NeverScrollableScrollPhysics(),
elevation: 3, padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
shape: cardRadius(8), itemBuilder: (context, _index) {
child: Column( return Container(
children: [ decoration: BoxDecoration(
Column(children: [ borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(width: 1, color: Color(0xffEFEFEF)),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
child: Column(
children: [
Column(children: [
Padding(
padding: EdgeInsets.all(10),
child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
])),
Divider(color: Colors.black, height: 1.5, thickness: 1.5),
Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Container(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Texts(
result.patientName,
fontWeight: FontWeight.w600,
fontSize: 12,
)),
Expanded(
flex: 1,
child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22),
onPressed: () {
acceptRemoveRequest(result.iD, 3, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22),
color: Colors.white,
onPressed: () {
acceptRemoveRequest(result.iD, 4, context);
},
))
],
));
}).toList())
])
],
));
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: 1);
}
},
))),
// RoundedContainer(
// child: ExpansionTile(
// title: Text(
// TranslationBase.of(context).userViewRequest,
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
// ),
// children: <Widget>[
// FutureBuilder(
// future: getUserViewRequest(), // async work
// builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
// switch (snapshot.connectionState) {
// case ConnectionState.waiting:
// return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
// default:
// if (snapshot.hasError)
// return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
// else
// return Container(
// padding: EdgeInsets.all(15),
// child: Card(
// elevation: 3,
// shape: cardRadius(8),
// child: Column(
// children: [
// Column(children: [
// Padding(
// padding: EdgeInsets.all(10),
// child: Row(children: [
// Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
// ])),
// Divider(color: Colors.black, height: 1.5, thickness: 1.5),
// Column(
// children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
// return Container(
// padding: EdgeInsets.all(10),
// child: Row(
// children: <Widget>[
// Expanded(
// flex: 3,
// child: Texts(
// result.patientName,
// fontWeight: FontWeight.w600,
// fontSize: 12,
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.check_circle,
// color: Color(0xff349745),
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 3, context);
// },
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.close,
// color: Colors.red[900],
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 4, context);
// },
// ))
// ],
// ));
// }).toList())
// ])
// ],
// )));
// }
// })
// ],
// ),
// ),
SizedBox(height: 15),
FractionallySizedBox(
widthFactor: 1.0,
child: AppExpandableNotifier(
title: TranslationBase.of(context).sentRequest,
bodyWidget: FutureBuilder(
future: getSentRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return SizedBox();
default:
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(width: 1, color: Color(0xffEFEFEF)),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
child: Column(
children: [
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row(children: [ child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)), Expanded(flex: 1, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600))
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
])), ])),
Divider(color: Colors.black, height: 1), Divider(color: Colors.black, height: 1.5, thickness: 1.5),
Column( Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) { children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Container( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)), Expanded(
Expanded( flex: 3,
flex: 1, child: Texts(
child: IconButton( result.patientName,
icon: Icon( fontWeight: FontWeight.w600,
Icons.check_circle, fontSize: 12,
color: Colors.black, )),
), Expanded(
onPressed: () { flex: 1,
acceptRemoveRequest(result.iD, 3, context); child: Card(
}, shape: cardRadius(10),
)), color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
Expanded( child: Padding(
flex: 1, padding: EdgeInsets.all(5),
child: IconButton( child: AppText(
icon: Icon( result.statusDescription,
Icons.delete, color: Colors.white,
color: Colors.black, textAlign: TextAlign.center,
), fontSize: 12,
onPressed: () { )))),
acceptRemoveRequest(result.iD, 4, context); ],
}, ));
)) }).toList(),
], )
)); ],
}).toList()) ));
]) },
], separatorBuilder: (context, index) => SizedBox(height: 14),
))); itemCount: 1,
} );
}) }
], }))),
), SizedBox(
height: 15,
), ),
RoundedContainer( FractionallySizedBox(
child: ExpansionTile( widthFactor: 1.0,
title: Text( child: AppExpandableNotifier(
TranslationBase.of(context).sentRequest, title: TranslationBase.of(context).userView,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), bodyWidget: FutureBuilder(
), future: getUserViewRequest(), // async work
children: <Widget>[ builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
FutureBuilder( switch (snapshot.connectionState) {
future: getSentRequest(), // async work case ConnectionState.waiting:
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) { return Padding(padding: EdgeInsets.only(top: 50), child: Text(''));
switch (snapshot.connectionState) { default:
case ConnectionState.waiting: if (snapshot.hasError)
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
default: else
if (snapshot.hasError) return Container(
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); decoration: BoxDecoration(
else borderRadius: BorderRadius.all(
return Container( Radius.circular(10.0),
padding: EdgeInsets.all(15), ),
height: SizeConfig.screenHeight * .3, border: Border.all(width: 1, color: Color(0xffEFEFEF)),
child: Card( boxShadow: [
elevation: 3, BoxShadow(
shape: cardRadius(8), color: Color(0xff000000).withOpacity(.05),
child: SingleChildScrollView( //spreadRadius: 5,
child: Column( blurRadius: 27,
children: [ offset: Offset(0, -3),
Padding( ),
padding: EdgeInsets.all(10), ],
child: Row(children: [ color: Colors.white),
Expanded(flex: 3, child: AppText(TranslationBase.of(context).theName, fontWeight: FontWeight.w600)),
Expanded(flex: 2, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600))
])),
Divider(color: Colors.black, height: 1),
Column(
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)),
Expanded(
flex: 2,
child: AppText(
result.statusDescription,
color: result.status == 3 ? Colors.green : Colors.red,
)),
],
));
}).toList(),
)
],
))));
}
})
],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return Container(
padding: EdgeInsets.all(15),
child: Card(
elevation: 3,
shape: cardRadius(8),
child: Column( child: Column(
children: [ children: [
Column(children: [ Column(children: [
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row(children: [ child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name)), Expanded(
Expanded(flex: 1, child: AppText(TranslationBase.of(context).delete)), flex: 3,
child: AppText(
TranslationBase.of(context).name,
fontWeight: FontWeight.w600,
)),
Expanded(
flex: 1,
child: AppText(
TranslationBase.of(context).delete,
fontWeight: FontWeight.w600,
textAlign: TextAlign.center,
)),
])), ])),
Divider(color: Colors.black), Divider(color: Colors.black, height: 1.5, thickness: 1.5),
Column( Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) { children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 3, child: AppText(result.patientName)), Expanded(
flex: 3,
child: Texts(
result.patientName,
fontWeight: FontWeight.w600,
fontSize: 12,
)),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
Icons.delete, Icons.delete,
color: Colors.black, color: Colors.red,
), ),
onPressed: () { onPressed: () {
deactivateRequest(result.iD, 5, context); deactivateRequest(result.iD, 5, context);
@ -445,11 +621,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}).toList()) }).toList())
]) ])
], ],
))); ));
} }
}) })))
],
))
], ],
), ),
), ),
@ -531,14 +705,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
result = list.CheckActivationCode.fromJson(result); result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE); var familyFile = await sharedPref.getObject(FAMILY_FILE);
var bloodType = await sharedPref.getString(BLOOD_TYPE);
var mainUser = await sharedPref.getObject(MAIN_USER); var mainUser = await sharedPref.getObject(MAIN_USER);
var loginType = await sharedPref.getInt(LAST_LOGIN); var loginType = await sharedPref.getInt(LAST_LOGIN);
this.sharedPref.clear(); this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) { if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true; result.list.isFamily = true;
} }
this.sharedPref.setString(BLOOD_TYPE, bloodType);
this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setInt(LAST_LOGIN, loginType); this.sharedPref.setInt(LAST_LOGIN, loginType);
this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(MAIN_USER, mainUser);
@ -546,7 +720,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
_vitalSignService.heightCm = "";
_vitalSignService.weightKg = "";
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).user = authenticatedUserObject.user; Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).user = authenticatedUserObject.user;
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).setUser(authenticatedUserObject.user); Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).setUser(authenticatedUserObject.user);

@ -51,12 +51,15 @@ class NotificationsDetailsPage extends StatelessWidget {
), ),
Container( Container(
width: double.infinity, width: double.infinity,
color: Colors.grey[400],
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false),
fontSize: 16, style: TextStyle(
fontSize: 18.0,
color: Colors.black,
fontWeight: FontWeight.w600
),
), ),
), ),
), ),
@ -88,7 +91,7 @@ class NotificationsDetailsPage extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Center( child: Center(
child: Texts(notification.message), child: Text(notification.message),
), ),
), ),
], ],

@ -1,16 +1,17 @@
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class NotificationsPage extends StatelessWidget { class NotificationsPage extends StatelessWidget {
@ -18,9 +19,7 @@ class NotificationsPage extends StatelessWidget {
DateTime d = DateUtil.convertStringToDate(date); DateTime d = DateUtil.convertStringToDate(date);
String monthName = DateUtil.getMonth(d.month).toString(); String monthName = DateUtil.getMonth(d.month).toString();
TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute); TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute);
String minute = timeOfDay.minute < 10 String minute = timeOfDay.minute < 10 ? timeOfDay.minute.toString().padLeft(2, '0') : timeOfDay.minute.toString();
? timeOfDay.minute.toString().padLeft(2, '0')
: timeOfDay.minute.toString();
String hour = '${timeOfDay.hourOfPeriod}:$minute'; String hour = '${timeOfDay.hourOfPeriod}:$minute';
if (timeOfDay.period == DayPeriod.am) { if (timeOfDay.period == DayPeriod.am) {
@ -39,112 +38,184 @@ class NotificationsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var prescriptionReport; ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<NotificationViewModel>( return BaseView<NotificationViewModel>(
onModelReady: (model) { onModelReady: (model) {
GetNotificationsRequestModel getNotificationsRequestModel = GetNotificationsRequestModel getNotificationsRequestModel = new GetNotificationsRequestModel(currentPage: currentIndex, pagingSize: 14, notificationStatusID: 2);
new GetNotificationsRequestModel(
currentPage: currentIndex,
pagingSize: 14,
notificationStatusID: 2);
model.getNotifications(getNotificationsRequestModel, context); model.getNotifications(getNotificationsRequestModel, context);
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).notifications, appBarTitle: TranslationBase.of(context).notifications,
baseViewModel: model, baseViewModel: model,
body: ListView( body: ListView.separated(
children: model.notifications itemBuilder: (context, index) {
.map( return InkWell(
(notification) => InkWell( onTap: () async {
onTap: () async { if (!model.notifications[index].isRead) {
if (!notification.isRead) { model.markAsRead(model.notifications[index].id);
model.markAsRead(notification.id); }
} Navigator.push(
Navigator.push( context,
context, FadePage(
FadePage( page: NotificationsDetailsPage(
page: NotificationsDetailsPage( notification: model.notifications[index],
notification: notification, )));
))); },
}, child: Container(
child: Container( width: double.infinity,
width: double.infinity, padding: EdgeInsets.all(8.0),
margin: EdgeInsets.only( decoration: BoxDecoration(
top: 5, left: 10, right: 10, bottom: 5), color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05),
padding: EdgeInsets.all(8.0), border: projectViewModel.isArabic
decoration: BoxDecoration( ? Border(
color: Colors.white, right: BorderSide(
borderRadius: BorderRadius.all( color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor,
Radius.circular(10.0), width: 5.0,
), ),
border: Border.all( )
color: notification.isRead : Border(
? Colors.grey[200] left: BorderSide(
: CustomColors.accentColor, color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor,
width: 0.5), width: 5.0,
),
child: Row(
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: Texts(notification.message)),
if (notification.messageType == "image")
Icon(FontAwesomeIcons.images)
],
),
SizedBox(
height: 5,
),
],
), ),
), ),
),
child: Row(
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) +
" " +
DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false)),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(child: Texts(model.notifications[index].message)),
if (model.notifications[index].messageType == "image")
Icon(
FontAwesomeIcons.images,
color: CustomColors.grey,
)
],
),
SizedBox(
height: 5,
),
],
),
), ),
SizedBox( ),
width: 15, ],
),
],
),
), ),
), ),
) );
.toList() },
..add( separatorBuilder: (context, index) {
InkWell( return Column(
onTap: () async { children: [
GifLoaderDialogUtils.showMyDialog(context); Divider(
currentIndex++; color: Colors.grey[300],
GetNotificationsRequestModel thickness: 2.0,
getNotificationsRequestModel =
new GetNotificationsRequestModel(
currentPage: currentIndex,
pagingSize: 14,
notificationStatusID: 2);
await model.getNotifications(
getNotificationsRequestModel, context);
GifLoaderDialogUtils.hideDialog(context);
},
child: Center(
child: Image.asset('assets/images/notf.png'),
),
), ),
)), ],
), );
},
itemCount: model.notifications.length)),
// ListView(
// children: model.notifications
// .map(
// (notification) => InkWell(
// onTap: () async {
// if (!notification.isRead) {
// model.markAsRead(notification.id);
// }
// Navigator.push(
// context,
// FadePage(
// page: NotificationsDetailsPage(
// notification: notification,
// )));
// },
// child: Container(
// width: double.infinity,
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: notification.isRead ? CustomColors.white : CustomColors.accentColor.withOpacity(0.05),
// border: Border(
// left: BorderSide(
// color: notification.isRead ? Colors.grey[200] : CustomColors.accentColor,
// width: 5.0,
// ),
// ),
// ),
// child: Row(
// children: <Widget>[
// Expanded(
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)),
// SizedBox(
// height: 5,
// ),
// Row(
// children: [
// Expanded(
// child: Texts(notification.message)),
// if (notification.messageType == "image")
// Icon(FontAwesomeIcons.images, color: CustomColors.grey,)
// ],
// ),
// SizedBox(
// height: 5,
// ),
// Divider(
// height: 5.0,
// color: CustomColors.grey2,
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// ),
// )
// .toList()
// ..add(
// InkWell(
// onTap: () async {
// GifLoaderDialogUtils.showMyDialog(context);
// currentIndex++;
// GetNotificationsRequestModel
// getNotificationsRequestModel =
// new GetNotificationsRequestModel(
// currentPage: currentIndex,
// pagingSize: 14,
// notificationStatusID: 2);
//
// await model.getNotifications(
// getNotificationsRequestModel, context);
// GifLoaderDialogUtils.hideDialog(context);
// },
// child: Center(
// child: Image.asset('assets/images/notf.png'),
// ),
// ),
// )),
); );
} }
} }

@ -2,75 +2,75 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
class ConfirmExitPageDialog extends StatelessWidget { // class ConfirmExitPageDialog extends StatelessWidget {
final GestureTapCallback onTapYes; // final GestureTapCallback onTapYes;
final GestureTapCallback onTapNo; // final GestureTapCallback onTapNo;
//
const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo}) // const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo})
: super(key: key); // : super(key: key);
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return SimpleDialog( // return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), // contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center( // title: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).confirm, // TranslationBase.of(context).confirm,
color: Colors.black, // color: Colors.black,
), // ),
), // ),
children: [ // children: [
Column( // Column(
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
Texts( // Texts(
"Are you sure you want to exit this page ?", // "Are you sure you want to exit this page ?",
color: Colors.grey, // color: Colors.grey,
), // ),
SizedBox( // SizedBox(
height: 5, // height: 5,
), // ),
Divider(), // Divider(),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
InkWell( // InkWell(
onTap: () { // onTap: () {
onTapNo(); // onTapNo();
}, // },
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).no, // TranslationBase.of(context).no,
color: Colors.red, // color: Colors.red,
), // ),
), // ),
), // ),
), // ),
//
InkWell( // InkWell(
onTap: () { // onTap: () {
Navigator.pop(context); // Navigator.pop(context);
onTapYes(); // onTapYes();
}, // },
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts(TranslationBase.of(context).yes), // child: Texts(TranslationBase.of(context).yes),
), // ),
), // ),
), // ),
], // ],
), // ),
SizedBox( // SizedBox(
height: 20.0, // height: 20.0,
), // ),
], // ],
) // )
], // ],
); // );
} // }
} // }

@ -30,14 +30,12 @@ class _DdServicesPageState extends State<DdServicesPage> {
void initState() { void initState() {
super.initState(); super.initState();
pageController = new PageController(); pageController = new PageController();
} }
_changePageViewIndex(int tab) { _changePageViewIndex(int tab) {
setState(() { setState(() {
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
pageController.animateToPage(tab, pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
}); });
} }
@ -99,25 +97,28 @@ class _DdServicesPageState extends State<DdServicesPage> {
selectedQuestions: selectedQuestions, selectedQuestions: selectedQuestions,
triageInformationRequest: triageInformationRequest, triageInformationRequest: triageInformationRequest,
), ),
EdPaymentInformationPage(selectedHospital: triageInformationRequest.selectedHospital,) EdPaymentInformationPage(
selectedHospital: triageInformationRequest.selectedHospital,
)
], ],
), ),
); );
} }
void showConfirmMessage( // todo 'sikander' remove useless code
BuildContext context, // void showConfirmMessage(
) { // BuildContext context,
showDialog( // ) {
context: context, // showDialog(
child: ConfirmExitPageDialog( // context: context,
onTapYes: () { // child: ConfirmExitPageDialog(
Navigator.pop(context); // onTapYes: () {
}, // Navigator.pop(context);
onTapNo: () { // },
Navigator.pop(context); // onTapNo: () {
}, // Navigator.pop(context);
), // },
); // ),
} // );
// }
} }

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailab
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -106,6 +107,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.actualDoctorRate, widget.appo.actualDoctorRate,
widget.appo.noOfPatientsRate, widget.appo.noOfPatientsRate,
"", "",
decimalDoctorRate: widget.appo.decimalDoctorRate.toString()
//model.user.emailAddress, //model.user.emailAddress,
), ),
isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
@ -186,7 +188,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
list.add( list.add(
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancelAppointment,
() { () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
@ -197,8 +199,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}, },
color: Color(0xffEAEAEA), color: CustomColors.accentColor,
textColor: Color(0xff000000), textColor: CustomColors.white,
), ),
), ),
); );
@ -218,7 +220,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
list.add( list.add(
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancelAppointment,
() { () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
@ -229,7 +231,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}, },
// color: Color(0xffEAEAEA), color: CustomColors.accentColor,
// textColor: Color(0xff000000), // textColor: Color(0xff000000),
), ),
), ),
@ -326,12 +328,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
child: Column( child: Column(
children: [ children: [
Container( Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
color: Theme.of(context).primaryColor,
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black))),
Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),

@ -167,7 +167,6 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
Navigator.of(context).pop();
}); });
} }

@ -1,33 +1,30 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
class SchedulePage extends StatefulWidget { class SchedulePage extends StatefulWidget {
DoctorList doctorList; DoctorList doctorList;
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
SchedulePage({ SchedulePage({
this.appo, this.appo,
this.doctorList, this.doctorList,
}); });
@override @override
_SchedulePageState createState() => _SchedulePageState(); _SchedulePageState createState() => _SchedulePageState();
} }
@ -45,6 +42,7 @@ class _SchedulePageState extends State<SchedulePage> {
bool isPageChange = false; bool isPageChange = false;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
void initState() { void initState() {
this.doctorList = widget.doctorList; this.doctorList = widget.doctorList;
@ -56,169 +54,132 @@ class _SchedulePageState extends State<SchedulePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getDoctorSchedule(doctorList), onModelReady: (model) => model.getDoctorSchedule(doctorList),
allowAny: true, allowAny: true,
builder: (_, model, widget) => BaseView<MedicalViewModel>( builder: (_, model, widget) => BaseView<MedicalViewModel>(
onModelReady: (model2) => model2.getFreeSlots(doctorList), onModelReady: (model2) => model2.getFreeSlots(doctorList),
allowAny: true, allowAny: true,
builder: (_, model2, widget2) { builder: (_, model2, widget2) {
if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) { if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) {
this.freeSlots = model2.freeSlots; this.freeSlots = model2.freeSlots;
this.doctorScheduleResponse = model.getDoctorScheduleList; this.doctorScheduleResponse = model.getDoctorScheduleList;
this.generateWeeksSchedules(); this.generateWeeksSchedules();
} else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) { } else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) {
AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule); AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule);
Navigator.pop(context); Navigator.pop(context);
} }
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).schedule, appBarTitle: TranslationBase.of(context).schedule,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Color(0xffF7F7F7), baseViewModel: model2,
baseViewModel: model2, isShowDecPage: false,
isShowDecPage: false, body: SizedBox(
body: Column( height: MediaQuery.of(context).size.height,
children: [ child: Stack(
SizedBox(height: 21), children: [
PageViewIndicator( Container(
isActive: true, margin: EdgeInsets.only(top: 40),
currentPage: this.currentPage, child: PageView.builder(
length: weeks.length, controller: _pageController,
), itemCount: weeks.length,
Expanded( onPageChanged: (index) {
child: PageView.builder( setState(() {
controller: _pageController, isPageChange = true;
itemCount: weeks.length, this.currentPage = index.toDouble();
onPageChanged: (index) { });
setState(() { },
isPageChange = true; itemBuilder: (context, index) {
this.currentPage = index.toDouble(); return Container(
}); child: ListView.builder(
}, itemCount: weeks[index].length,
itemBuilder: (context, index) { itemBuilder: (context, index2) => InkWell(
return ListView.separated( onTap: () {
itemCount: weeks[index].length, openBookAppointment(weeks[index][index2]);
padding: EdgeInsets.all(21), },
separatorBuilder: (context, index) => SizedBox(height: 12), child: Row(
itemBuilder: (context, index2) { children: [
bool isToday = DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10); Expanded(
Color toDayColor = isToday ? Color(0xff359846) : Colors.white; flex: 1,
child: Padding(
return InkWell( padding: projectViewModel.isArabic ? EdgeInsets.only(right: 20) : EdgeInsets.only(left: 20),
onTap: () { child: Row(children: [
openBookAppointment(weeks[index][index2]); Column(
children: [
Texts(
weeks[index][index2]['DayName'],
fontSize: 13,
fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500,
),
Texts(
getDayMonths(
DateUtil.convertStringToDate(
weeks[index][index2]['Date'],
),
),
fontWeight: FontWeight.bold,
fontSize: 18,
)
],
)
])),
),
Expanded(
flex: 3,
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 15, bottom: 20),
margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7),
decoration: BoxDecoration(boxShadow: [
DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10)
? BoxShadow(color: Colors.green, offset: Offset(projectViewModel.isArabic ? 5 : -5, 0))
: BoxShadow(
color: Colors.grey[100],
blurRadius: 5,
spreadRadius: 4,
offset: Offset(0, 10),
),
], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10)
? Texts(
TranslationBase.of(context).today,
color: Colors.green,
fontWeight: FontWeight.w600,
fontSize: 12,
marginTop: 0,
)
: SizedBox(),
Row(
children: [
Expanded(
child: Text(
weeks[index][index2]['WorkingHours'],
style: TextStyle(
fontWeight: FontWeight.w600,
),
),
),
Icon(Icons.arrow_forward, size: 16.0),
],
)
]))),
),
],
))));
}, },
child: Row( )),
crossAxisAlignment: CrossAxisAlignment.start, PageViewIndicator(
children: [ isActive: true,
Expanded( currentPage: this.currentPage,
flex: 1, length: weeks.length,
child: Column( )
mainAxisSize: MainAxisSize.min, ],
crossAxisAlignment: CrossAxisAlignment.start, )));
children: [ }));
Text(
weeks[index][index2]['DayName'],
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.52,
),
),
Text(
getDayMonths(DateUtil.convertStringToDate(weeks[index][index2]['Date'])),
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
color: Color(0xff2E303A),
letterSpacing: -0.72,
),
),
],
),
),
Expanded(
flex: 3,
child: Container(
decoration: BoxDecoration(
color: toDayColor,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Container(
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
if (isToday)
Text(
TranslationBase.of(context).today,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: toDayColor,
letterSpacing: -0.48,
),
),
Row(
children: [
Expanded(
child: Text(
weeks[index][index2]['WorkingHours'],
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
),
],
)
]),
),
Icon(Icons.arrow_forward, color: Color(0xff2B353E)),
],
),
),
),
),
],
),
);
});
},
),
),
],
),
);
}),
);
} }
generateWeeksSchedules() { generateWeeksSchedules() {
@ -284,3 +245,289 @@ class _SchedulePageState extends State<SchedulePage> {
// ); // );
} }
} }
// import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
// import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
//
// import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart';
// import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart';
// import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
// import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
// import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
// import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
// import 'package:flutter/material.dart';
// import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
// import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
// import 'package:diplomaticquarterapp/pages/base/base_view.dart';
// import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
// import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
// import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
// import 'package:diplomaticquarterapp/uitl/app_toast.dart';
// import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
// import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
// import 'package:provider/provider.dart';
// import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
//
// class SchedulePage extends StatefulWidget {
// DoctorList doctorList;
// AppoitmentAllHistoryResultList appo;
// SchedulePage({
// this.appo,
// this.doctorList,
// });
// @override
// _SchedulePageState createState() => _SchedulePageState();
// }
//
// class _SchedulePageState extends State<SchedulePage> {
// DoctorsListService service;
// PageController _pageController = PageController();
// double currentPage = 0;
// int selectedindex = 0;
// List weeks = [];
// List<DoctorScheduleResponse> doctorScheduleResponse = [];
// int weekMS = 604800 * 1000;
// DoctorList doctorList;
// List<String> freeSlots = [];
// bool isPageChange = false;
//
// AppSharedPreferences sharedPref = AppSharedPreferences();
// @override
// void initState() {
// this.doctorList = widget.doctorList;
//
// super.initState();
// }
//
// @override
// Widget build(BuildContext context) {
// ProjectViewModel projectViewModel = Provider.of(context);
// return BaseView<MedicalViewModel>(
// onModelReady: (model) => model.getDoctorSchedule(doctorList),
// allowAny: true,
// builder: (_, model, widget) => BaseView<MedicalViewModel>(
// onModelReady: (model2) => model2.getFreeSlots(doctorList),
// allowAny: true,
// builder: (_, model2, widget2) {
// if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) {
// this.freeSlots = model2.freeSlots;
// this.doctorScheduleResponse = model.getDoctorScheduleList;
//
// this.generateWeeksSchedules();
// } else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) {
// AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule);
// Navigator.pop(context);
// }
// return AppScaffold(
// appBarTitle: TranslationBase.of(context).schedule,
// showNewAppBar: true,
// showNewAppBarTitle: true,
// isShowAppBar: true,
// backgroundColor: Color(0xffF7F7F7),
// baseViewModel: model2,
// isShowDecPage: false,
// body: Column(
// children: [
// SizedBox(height: 21),
// PageViewIndicator(
// isActive: true,
// currentPage: this.currentPage,
// length: weeks.length,
// ),
// Expanded(
// child: PageView.builder(
// controller: _pageController,
// itemCount: weeks.length,
// onPageChanged: (index) {
// setState(() {
// isPageChange = true;
// this.currentPage = index.toDouble();
// });
// },
// itemBuilder: (context, index) {
// return ListView.separated(
// itemCount: weeks[index].length,
// padding: EdgeInsets.all(21),
// separatorBuilder: (context, index) => SizedBox(height: 12),
// itemBuilder: (context, index2) {
// bool isToday = DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10);
// Color toDayColor = isToday ? Color(0xff359846) : Colors.white;
// return InkWell(
// onTap: () {
// openBookAppointment(weeks[index][index2]);
// },
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Expanded(
// flex: 1,
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// weeks[index][index2]['DayName'],
// style: TextStyle(
// fontSize: 13,
// fontWeight: FontWeight.w600,
// color: Color(0xff2E303A),
// letterSpacing: -0.52,
// ),
// ),
// Text(
// getDayMonths(DateUtil.convertStringToDate(weeks[index][index2]['Date'])),
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.w700,
// color: Color(0xff2E303A),
// letterSpacing: -0.72,
// ),
// ),
// ],
// ),
// ),
// Expanded(
// flex: 3,
// child: Container(
// decoration: BoxDecoration(
// color: toDayColor,
// borderRadius: BorderRadius.all(
// Radius.circular(10.0),
// ),
// boxShadow: [
// BoxShadow(
// color: Color(0xff000000).withOpacity(.05),
// blurRadius: 27,
// offset: Offset(0, -3),
// ),
// ],
// ),
// child: Container(
// margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
// padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
// decoration: BoxDecoration(
// color: Colors.white,
// border: Border.all(color: Colors.white, width: 1),
// borderRadius: BorderRadius.only(
// bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
// topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
// bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
// topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
// ),
// ),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
// if (isToday)
// Text(
// TranslationBase.of(context).today,
// style: TextStyle(
// fontSize: 12,
// fontWeight: FontWeight.w600,
// color: toDayColor,
// letterSpacing: -0.48,
// ),
// ),
// Row(
// children: [
// Expanded(
// child: Text(
// weeks[index][index2]['WorkingHours'],
// style: TextStyle(
// fontSize: 13,
// fontWeight: FontWeight.w600,
// color: Color(0xff2E303A),
// letterSpacing: -0.56,
// ),
// ),
// ),
// ],
// )
// ]),
// ),
// Icon(Icons.arrow_forward, color: Color(0xff2B353E)),
// ],
// ),
// ),
// ),
// ),
// ],
// ),
// );
// });
// },
// ),
// ),
// ],
// ),
// );
// }),
// );
// }
//
// generateWeeksSchedules() {
// this.weeks.clear();
// for (var i = 0; i < 8; i++) {
// var weekSchedule = generateNewWeekSchedule(i);
// this.markWeekFreeDays(weekSchedule);
// this.weeks.add(weekSchedule);
// }
// //print(this.weeks);
// }
//
// markWeekFreeDays(schedule) {
// for (var workDay in schedule) {
// workDay['fullDay'] = !this.hasFreeSlot(workDay['Date']);
// }
// }
//
// generateNewWeekSchedule(weekIndex) {
// var weekMSOffset = weekIndex * weekMS;
//
// var newWeekSchedule = [];
// for (var workDay in this.doctorScheduleResponse) {
// Map<String, dynamic> newWorkDay = Map();
// newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate(DateUtil.convertStringToDate(workDay.date).millisecondsSinceEpoch + weekMSOffset);
// newWorkDay['DayName'] = workDay.dayName;
// newWorkDay['WorkingHours'] = workDay.workingHours;
// newWeekSchedule.add(newWorkDay);
// }
// return newWeekSchedule;
// }
//
// hasFreeSlot(String jsonDate) {
// var date = DateUtil.convertStringToDate(jsonDate);
// var scheduleDay = date;
// for (var event in this.freeSlots) {
// var date = DateUtil.convertStringToDate(event);
// var nDate = DateTime(date.year, date.month, date.day);
//
// if (nDate.millisecondsSinceEpoch == scheduleDay.millisecondsSinceEpoch) {
// return true;
// }
// }
// return false;
// }
//
// String getDayMonths(DateTime dateTime) {
// String dateFormat = '${dateTime.day} ${DateUtil.getMonth(dateTime.month).toString().substring(0, 3)}';
// return dateFormat;
// }
//
// openBookAppointment(selectedDate) {
// //sharedPref.setObject(DOCTOR_SCHEDULE_DATE_SEL, selectedDate);
// Navigator.of(context).pop(selectedDate);
// // Navigator.push(
// // context,
// // FadePage(
// // page: AppointmentDetails(
// // appo: widget.appo,
// // doctorSchedule: selectedDate,
// // ),
// // ),
// // );
// }
// }

@ -381,12 +381,12 @@ class _AppointmentActionsState extends State<AppointmentActions> {
print(finalRadiology.reportData); print(finalRadiology.reportData);
navigateToRadiologyDetails(finalRadiology); navigateToRadiologyDetails(finalRadiology);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: TranslationBase.of(context).noResultFound);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: TranslationBase.of(context).noResultFound);
}); });
} }

@ -57,6 +57,8 @@ class _ToDoState extends State<ToDo> {
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
CountdownTimerController controller; CountdownTimerController controller;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
@ -73,7 +75,7 @@ class _ToDoState extends State<ToDo> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList, appBarTitle: TranslationBase.of(context).todoList,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
@ -169,12 +171,12 @@ class _ToDoState extends State<ToDo> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: 1.0)), style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: -0.64)),
if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n") if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n")
Container( Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0), margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(), child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(),
style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)), style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: -0.64)),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -267,7 +269,7 @@ class _ToDoState extends State<ToDo> {
color: Color(0xff20bc44), color: Color(0xff20bc44),
), ),
height: 30.0, height: 30.0,
padding: EdgeInsets.only(right: 15), padding: EdgeInsets.only(right: 10, left: 10),
margin: EdgeInsets.symmetric(horizontal: 20), margin: EdgeInsets.symmetric(horizontal: 20),
transform: Matrix4.translationValues(0.0, -8.0, 0.0), transform: Matrix4.translationValues(0.0, -8.0, 0.0),
child: Row( child: Row(
@ -319,11 +321,11 @@ class _ToDoState extends State<ToDo> {
break; break;
case 15: case 15:
return widget.languageID == 'ar' ? "assets/images/new-design/pay_online_button_arabic_disabled.png" : "assets/images/new-design/pay_online_button_disabled.png"; return projectViewModel.isArabic ? "assets/images/new-design/pay_online_button_arabic_disabled.png" : "assets/images/new-design/pay_online_button_disabled.png";
break; break;
case 20: case 20:
return widget.languageID == 'ar' ? "assets/images/new-design/pay_online_button_arabic.png" : "assets/images/new-design/pay_online_button.png"; return projectViewModel.isArabic ? "assets/images/new-design/pay_online_button_arabic.png" : "assets/images/new-design/pay_online_button.png";
break; break;
case 30: case 30:

@ -60,7 +60,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0, height: 60.0,
width: 60, width: 60,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
child: Image.asset("assets/images/new-design/mada.png"), child: Image.asset("assets/images/new/payment/Mada.png"),
), ),
mWidth(12), mWidth(12),
Text( Text(
@ -96,7 +96,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0, height: 60.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: 60, width: 60,
child: Image.asset("assets/images/new-design/visa.png"), child: Image.asset("assets/images/new/payment/visa.png"),
), ),
mWidth(12), mWidth(12),
Text( Text(
@ -132,7 +132,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0, height: 60.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: 60, width: 60,
child: Image.asset("assets/images/new-design/mastercard.png"), child: Image.asset("assets/images/new/payment/Mastercard.png"),
), ),
mWidth(12), mWidth(12),
Text( Text(
@ -168,7 +168,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0, height: 60.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: 60, width: 60,
child: Image.asset("assets/images/new-design/installment.png"), child: Image.asset("assets/images/new/payment/installments.png"),
), ),
mWidth(12), mWidth(12),
Text( Text(
@ -205,7 +205,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0, height: 60.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: 60, width: 60,
child: SvgPicture.asset("assets/images/new-design/applepay.svg"), child: Image.asset("assets/images/new/payment/Apple_Pay.png"),
), ),
mWidth(12), mWidth(12),
Text( Text(

@ -1,8 +1,12 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
class PaymentDialog extends StatefulWidget { class PaymentDialog extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
@ -21,159 +25,91 @@ class _PaymentDialogState extends State<PaymentDialog> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
child: Dialog( child: Dialog(
shape: shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container( child: Container(
height: 550.0, height: 550.0,
width: 450.0, width: 450.0,
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, Container(
mainAxisSize: MainAxisSize.max, margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0),
children: <Widget>[ child: Text(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w600)),
Container( ),
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), Container(
child: Text("Invoice Detail", margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0),
style: TextStyle( child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600)),
fontSize: 25.0, ),
fontWeight: FontWeight.bold, Container(
fontFamily: "Open-Sans-Bold")), margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0),
), child: Text(getDate(widget.appo.appointmentDate), style: getTextStyle()),
Divider( ),
color: Colors.grey, Container(
), margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0),
Container( child: Text(widget.appo.projectName, style: getTextStyle()),
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), ),
child: Text("Appointment Details", Divider(
style: TextStyle( color: Colors.grey,
fontSize: 15.0, ),
fontWeight: FontWeight.bold, Container(
fontFamily: "Open-Sans-Bold")), margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0),
), child: Table(
Container( children: [
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), TableRow(decoration: BoxDecoration(), children: [
child: Text( TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())),
style: TextStyle( ]),
color: Colors.grey[700], TableRow(children: [
fontSize: 15.0, TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
fontWeight: FontWeight.bold, TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())),
fontFamily: "Open-Sans-Bold")), ]),
), TableRow(children: [
Container( TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())),
child: Text(getDate(widget.appo.appointmentDate), ]),
style: getTextStyle()), ],
), ),
Container( ),
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), Divider(
child: Text(widget.appo.projectName, style: getTextStyle()), color: Colors.grey,
), ),
Divider( Container(
color: Colors.grey, margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0),
), child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600)),
Container( ),
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()),
child: Table( Container(
children: [ margin: EdgeInsets.fromLTRB(20.0, 30.0, 20.0, 15.0),
TableRow(children: [ child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600)),
TableCell( ),
child: _getNormalText( Container(
TranslationBase.of(context).patientShareToDo)), alignment: Alignment.center,
TableCell( height: 40.0,
child: _getNormalText(widget margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
.patientShareResponse.patientShare child: Flex(
.toString())), direction: Axis.horizontal,
]), children: <Widget>[
TableRow(children: [ Expanded(
TableCell( child: DefaultButton(
child: _getNormalText( TranslationBase.of(context).cancel,
TranslationBase.of(context).patientTaxToDo)), () {
TableCell( Navigator.pop(context, null);
child: _getNormalText(widget },
.patientShareResponse.patientTaxAmount color: Color(0xffEAEAEA),
.toString())), textColor: Colors.black,
]), ),
TableRow(children: [
TableCell(
child: _getNormalText(TranslationBase.of(context)
.patientShareTotalToDo)),
TableCell(
child: _getNormalText(widget
.patientShareResponse.patientShareWithTax
.toString())),
]),
],
), ),
), mWidth(10.0),
Container( Expanded(
alignment: Alignment.center, child: DefaultButton(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), TranslationBase.of(context).confirm,
child: Text("You can pay by following options: ", () {
textAlign: TextAlign.center, Navigator.pop(context, widget.patientShareResponse);
style: TextStyle( },
fontSize: 16.0, ),
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans")),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0),
child: Image.asset(
"assets/images/new-design/payment_options_invoice_confirmation.png",
width: 300),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 15.0),
child: Text(
"Are You Sure You Want To Make payment for this Appointment?",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.0,
color: Colors.red[700],
fontFamily: "Open-Sans")),
),
Divider(
color: Colors.grey,
),
Container(
alignment: Alignment.center,
height: 40.0,
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () {
Navigator.pop(context, null);
},
child: Container(
child: Text("Cancel",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18.0, color: Colors.red[700])),
),
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.pop(context, widget.patientShareResponse);
// widget.onPaymentMethodSelected();
},
child: Container(
child: Text("Ok",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18.0,
)),
),
),
),
],
), ),
), ],
]), ),
),
]),
), ),
), ),
); );
@ -182,35 +118,17 @@ class _PaymentDialogState extends State<PaymentDialog> {
_getNormalText(text) { _getNormalText(text) {
return Container( return Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0), margin: EdgeInsets.only(top: 10.0, right: 10.0),
child: Text(text, child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.black)),
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontFamily: 'Open-Sans',
letterSpacing: 0.5,
color: Colors.grey[700])),
); );
} }
TextStyle getTextStyle() { TextStyle getTextStyle() {
return TextStyle( return TextStyle(color: Colors.grey[700], fontSize: 13.0, fontWeight: FontWeight.w600);
color: Colors.grey[700], fontSize: 15.0, fontFamily: "Open-Sans-Bold");
} }
// Future navigateToPaymentMethod(context) async {
// Navigator.push(
// context, MaterialPageRoute(builder: (context) => PaymentMethod()));
// }
String getDate(String date) { String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date); DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) + return DateUtil.getDayMonthYearDateFormatted(dateObj) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString() +
" " + " " +
dateObj.hour.toString() + dateObj.hour.toString() +
":" + ":" +

@ -17,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'; import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart';
@ -50,6 +51,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
var _currentLocaleId; var _currentLocaleId;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
int selectedStatusIndex = 5;
var event = RobotProvider(); var event = RobotProvider();
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
@ -165,16 +167,16 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
}); });
}, },
child: DoctorCard( child: DoctorCard(
onTap: null, onTap: null,
isInOutPatient: appointHistory.isInOutPatient, isInOutPatient: appointHistory.isInOutPatient,
name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj,
// billNo: _appointmentResult.invoiceNo, // billNo: _appointmentResult.invoiceNo,
profileUrl: appointHistory.doctorImageURL, profileUrl: appointHistory.doctorImageURL,
subName: appointHistory.projectName, subName: appointHistory.projectName,
isLiveCareAppointment: appointHistory.isLiveCareAppointment, isLiveCareAppointment: appointHistory.isLiveCareAppointment,
date: DateUtil.convertStringToDate(appointHistory.appointmentDate), date: DateUtil.convertStringToDate(appointHistory.appointmentDate),
rating: appointHistory.actualDoctorRate + 0.0, rating: appointHistory.actualDoctorRate + 0.0,
appointmentTime: appointHistory.startTime.substring(0, 5), appointmentTime: appointHistory.startTime.substring(0, 5),
), ),
), ),
SizedBox(height: 12), SizedBox(height: 12),
@ -182,8 +184,9 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
Container( Container(
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17,
child: ListView.builder( child: ListView.separated(
itemCount: appoList.length, itemCount: appoList.length,
separatorBuilder: (ctx, index) => SizedBox(height: 12),
itemBuilder: (context, index) => InkWell( itemBuilder: (context, index) => InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
@ -309,6 +312,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
messageController.text = ""; messageController.text = "";
images = []; images = [];
}); });
selectedStatusIndex = 5;
setMessageType(MessageType.NON); setMessageType(MessageType.NON);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback); AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback);
@ -429,42 +433,107 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
// Show Dialog function // Show Dialog function
void confirmBox(FeedbackViewModel model) { void confirmBox(FeedbackViewModel model) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).notClassified, 5),
RadioSelectionDialogModel(TranslationBase.of(context).complainAppo, 1),
RadioSelectionDialogModel(TranslationBase.of(context).complainWithoutAppo, 2),
RadioSelectionDialogModel(TranslationBase.of(context).question, 3),
RadioSelectionDialogModel(TranslationBase.of(context).compliment, 4),
RadioSelectionDialogModel(TranslationBase.of(context).suggestion, 6),
];
showDialog( showDialog(
context: context, context: context,
child: FeedbackTypeDialog( child: RadioSelectionDialog(
messageTypeDialog: messageType, listData: list,
onValueSelected: (MessageType value) { selectedIndex: selectedStatusIndex,
if (value == MessageType.ComplaintOnAnAppointment) { onValueSelected: (index) {
appoList.clear(); selectedStatusIndex = index;
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { if (index == 1) {
GifLoaderDialogUtils.hideDialog(context); messageType = MessageType.ComplaintOnAnAppointment;
setState(() { } else if (index == 2) {
if (res['MessageStatus'] == 1) { messageType = MessageType.ComplaintWithoutAppointment;
if (res['AppoimentAllHistoryResultList'].length != 0) { } else if (index == 3) {
res['AppoimentAllHistoryResultList'].forEach((v) { messageType = MessageType.Question;
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); } else if (index == 4) {
}); messageType = MessageType.Compliment;
setState(() { } else if (index == 5) {
appointHistory = null; messageType = MessageType.NON;
isShowListAppointHistory = true; } else {
}); messageType = MessageType.Suggestion;
} else {} }
} else {
} if (messageType == MessageType.ComplaintOnAnAppointment) {
}); appoList.clear();
}).catchError((err) { GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.hideDialog(context); service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) {
// print(err); GifLoaderDialogUtils.hideDialog(context);
// AppToast.showErrorToast(message: err); setState(() {
// Navigator.of(context).pop(); if (res['MessageStatus'] == 1) {
if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
setState(() {
appointHistory = null;
isShowListAppointHistory = true;
});
} else {}
} else {}
}); });
} else { }).catchError((err) {
isShowListAppointHistory = false; GifLoaderDialogUtils.hideDialog(context);
} // print(err);
setMessageType(value); // AppToast.showErrorToast(message: err);
}, // Navigator.of(context).pop();
)); });
} else {
isShowListAppointHistory = false;
}
setMessageType(messageType);
},
),
);
return;
// todo 'sikander' remove useless code
// showDialog(
// context: context,
// child: FeedbackTypeDialog(
// messageTypeDialog: messageType,
// onValueSelected: (MessageType value) {
// if (value == MessageType.ComplaintOnAnAppointment) {
// appoList.clear();
// GifLoaderDialogUtils.showMyDialog(context);
// service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
// setState(() {
// if (res['MessageStatus'] == 1) {
// if (res['AppoimentAllHistoryResultList'].length != 0) {
// res['AppoimentAllHistoryResultList'].forEach((v) {
// appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
// });
// setState(() {
// appointHistory = null;
// isShowListAppointHistory = true;
// });
// } else {}
// } else {}
// });
// }).catchError((err) {
// GifLoaderDialogUtils.hideDialog(context);
// // print(err);
// // AppToast.showErrorToast(message: err);
// // Navigator.of(context).pop();
// });
// } else {
// isShowListAppointHistory = false;
// }
// setMessageType(value);
// },
// ));
} }
openSpeechReco() async { openSpeechReco() async {
@ -518,238 +587,238 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (!mounted) return; if (!mounted) return;
} }
} }
// todo 'sikander' remove useless code
class FeedbackTypeDialog extends StatefulWidget { // class FeedbackTypeDialog extends StatefulWidget {
final Function(MessageType) onValueSelected; // final Function(MessageType) onValueSelected;
final MessageType messageTypeDialog; // final MessageType messageTypeDialog;
//
const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key); // const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key);
//
@override // @override
State createState() => new FeedbackTypeDialogState(); // State createState() => new FeedbackTypeDialogState();
} // }
//
class FeedbackTypeDialogState extends State<FeedbackTypeDialog> { // class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
MessageType messageTypeDialog = MessageType.NON; // MessageType messageTypeDialog = MessageType.NON;
//
setMessageDialogType(MessageType messageType) { // setMessageDialogType(MessageType messageType) {
setState(() { // setState(() {
messageTypeDialog = messageType; // messageTypeDialog = messageType;
}); // });
} // }
//
@override // @override
void initState() { // void initState() {
messageTypeDialog = widget.messageTypeDialog; // messageTypeDialog = widget.messageTypeDialog;
//
super.initState(); // super.initState();
} // }
//
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return BaseView<FeedbackViewModel>( // return BaseView<FeedbackViewModel>(
builder: (_, model, widge) => SimpleDialog( // builder: (_, model, widge) => SimpleDialog(
title: Text( // title: Text(
TranslationBase.of(context).messageType, // TranslationBase.of(context).messageType,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
), // ),
children: <Widget>[ // children: <Widget>[
Container( // Container(
// padding: const EdgeInsets.all(10.0), // // padding: const EdgeInsets.all(10.0),
child: Column( // child: Column(
children: <Widget>[ // children: <Widget>[
Divider( // Divider(
height: 2.5, // height: 2.5,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.NON), // onTap: () => setMessageDialogType(MessageType.NON),
child: ListTile( // child: ListTile(
title: Texts(TranslationBase.of(context).notClassified), // title: Texts(TranslationBase.of(context).notClassified),
leading: Radio( // leading: Radio(
value: MessageType.NON, // value: MessageType.NON,
groupValue: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment), // onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment),
child: ListTile( // child: ListTile(
title: Texts(TranslationBase.of(context).complainAppo), // title: Texts(TranslationBase.of(context).complainAppo),
leading: Radio( // leading: Radio(
value: MessageType.ComplaintOnAnAppointment, // value: MessageType.ComplaintOnAnAppointment,
groupValue: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment), // onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment),
child: ListTile( // child: ListTile(
title: Texts(TranslationBase.of(context).complainWithoutAppo), // title: Texts(TranslationBase.of(context).complainWithoutAppo),
leading: Radio( // leading: Radio(
value: MessageType.ComplaintWithoutAppointment, // value: MessageType.ComplaintWithoutAppointment,
groupValue: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.Question), // onTap: () => setMessageDialogType(MessageType.Question),
child: ListTile( // child: ListTile(
title: Texts(TranslationBase.of(context).question), // title: Texts(TranslationBase.of(context).question),
leading: Radio( // leading: Radio(
value: MessageType.Question, // value: MessageType.Question,
groupValue: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.Compliment), // onTap: () => setMessageDialogType(MessageType.Compliment),
child: ListTile( // child: ListTile(
title: Texts(TranslationBase.of(context).compliment), // title: Texts(TranslationBase.of(context).compliment),
leading: Radio( // leading: Radio(
value: MessageType.Compliment, // value: MessageType.Compliment,
groupValue: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.Suggestion), // onTap: () => setMessageDialogType(MessageType.Suggestion),
child: ListTile( // child: ListTile(
title: Texts(TranslationBase.of(context).suggestion), // title: Texts(TranslationBase.of(context).suggestion),
leading: Radio( // leading: Radio(
value: MessageType.Suggestion, // value: MessageType.Suggestion,
groupValue: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Divider( // Divider(
height: 2.5, // height: 2.5,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
SizedBox( // SizedBox(
height: 5, // height: 5,
), // ),
Row( // Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: EdgeInsets.all(8.0), // padding: EdgeInsets.all(8.0),
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).cancel, // TranslationBase.of(context).cancel,
color: CustomColors.accentColor, // color: CustomColors.accentColor,
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
Container( // Container(
width: 1, // width: 1,
height: 30, // height: 30,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
widget.onValueSelected(messageTypeDialog); // widget.onValueSelected(messageTypeDialog);
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).ok, // TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
)), // )),
), // ),
)), // )),
], // ],
) // )
], // ],
), // ),
), // ),
], // ],
), // ),
); // );
} // }
} // }

@ -1,11 +1,17 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -18,6 +24,12 @@ class StatusFeedbackPage extends StatefulWidget {
} }
class _StatusFeedbackPageState extends State<StatusFeedbackPage> { class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
String countryCode = '966';
String mobileNo = "";
TextEditingController complainNumberController = TextEditingController();
StatusType statusType = StatusType.ComplaintNumber;
int selectedStatusIndex = 3;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -29,116 +41,299 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
child: model.cOCItemList.isNotEmpty child: projectViewModel.isLogin
? Container( ? model.cOCItemList.isNotEmpty
margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80), ? listData(model.cOCItemList, projectViewModel.isArabic, true)
child: ListView.builder( : Center(
itemCount: model.cOCItemList.length, child: Column(
itemBuilder: (context, index) => InkWell( children: [
onTap: () { SizedBox(
}, height: MediaQuery.of(context).size.height * 0.4,
child: Card( ),
shape: cardRadius(12), Image.asset(
margin: EdgeInsets.all(10), 'assets/images/comments.png',
child: Padding( width: 80,
padding: const EdgeInsets.all(12.0), height: 80,
child: Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, SizedBox(
children: [ height: 15,
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ TranslationBase.of(context).noSearchResult,
Text(projectViewModel.isArabic ? model.cOCItemList[index].statusAr : model.cOCItemList[index].status, style: TextStyle(
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), fontSize: 16,
Container( fontWeight: FontWeight.w600,
margin: EdgeInsets.only(top: 5.0), letterSpacing: -0.48,
child: Text(model.cOCItemList[index].formType.toString(), color: Color(0xff2B353E),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12))),
myRichText(TranslationBase.of(context).number + ": ", model.cOCItemList[index].itemID.toString(), projectViewModel.isArabic),
Text(model.cOCItemList[index].cOCTitle,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12)),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(model.cOCItemList[index].date.split(" ")[0],
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48)),
Text(model.cOCItemList[index].date.split(" ")[1].substring(0, 4),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48)),
],
),
],
),
),
), ),
)), ),
) ],
: Center( ),
)
: SingleChildScrollView(
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: MediaQuery.of(context).size.height * 0.4,
),
Image.asset(
'assets/images/comments.png',
width: 80,
height: 80,
),
SizedBox(
height: 15,
),
Text( Text(
TranslationBase.of(context).noSearchResult, TranslationBase.of(context).selectSearchCriteria,
style: TextStyle( style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
fontSize: 16, ),
fontWeight: FontWeight.w600, SizedBox(height: 21),
letterSpacing: -0.48, InkWell(
color: Color(0xff2B353E), onTap: () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).complaintNumber, 3),
RadioSelectionDialogModel(TranslationBase.of(context).fileNumber, 1),
RadioSelectionDialogModel(TranslationBase.of(context).identificationNumber, 2),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex: selectedStatusIndex,
onValueSelected: (index) {
selectedStatusIndex = index;
setState(() {
if (index == 3) {
statusType = StatusType.ComplaintNumber;
} else if (index == 1) {
statusType = StatusType.FileNumber;
} else {
statusType = StatusType.IdentificationNumber;
}
});
},
),
);
},
child: Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
getSelected(context),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xff2B353E),
),
),
Icon(
Icons.keyboard_arrow_down,
size: 22,
color: Colors.grey,
)
],
),
), ),
), ),
SizedBox(height: 12),
Directionality(
textDirection: TextDirection.ltr,
child: inputWidget(
statusType == StatusType.ComplaintNumber
? TranslationBase.of(context).enterComplainNumber
: (statusType == StatusType.FileNumber ? TranslationBase.of(context).enterfileNumber : TranslationBase.of(context).enterIdentificationNumber),
"",
complainNumberController,
isInputTypeNum: true)),
SizedBox(height: 12),
PhoneNumberSelectorWidget(onNumberChange: (value) {
setState(() {
mobileNo = value;
});
}, onCountryChange: (value) {
setState(() {
countryCode = value;
});
}),
], ],
), ),
), ),
), ),
if (!projectViewModel.isLogin)
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).search,
projectViewModel.isLogin || (mobileNo.length < 9) || (complainNumberController.text.isEmpty)
? null
: () {
model.searchFeedback(countryCode, mobileNo, selectedStatusIndex, complainNumberController.text).then((value) {
if (model.state == ViewState.ErrorLocal) {
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: model.error);
});
} else {
listData(model.cOCItemList, projectViewModel.isArabic, false);
}
});
},
disabledColor: Colors.grey,
),
),
], ],
), ),
bottomSheet: Container( ),
color: Colors.white, );
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), }
child: DefaultButton(
TranslationBase.of(context).search, Widget listData(List<COCItem> cOCItemList, bool isArabic, bool isLogin) {
projectViewModel.isLogin ? null : () => {}, return ListView.builder(
disabledColor: Colors.grey, padding: isLogin ? EdgeInsets.all(21) : null,
itemCount: cOCItemList.length,
shrinkWrap: isLogin ? false : true,
physics: isLogin ? null : NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => InkWell(
onTap: () {},
child: Card(
shape: cardRadius(12),
margin: EdgeInsets.all(10),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(isArabic ? cOCItemList[index].statusAr : cOCItemList[index].status, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(cOCItemList[index].formType.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12))),
myRichText(TranslationBase.of(context).number + ": ", cOCItemList[index].itemID.toString(), isArabic),
Text(cOCItemList[index].cOCTitle,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(cOCItemList[index].date.split(" ")[0],
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)),
Text(cOCItemList[index].date.split(" ")[1].substring(0, 4),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)),
],
),
],
),
), ),
), ),
), ),
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
}
gotodetails(item) { gotodetails(item) {
Navigator.pushReplacement(context, FadePage(page: FeedbackDetails(items: item))); Navigator.pushReplacement(context, FadePage(page: FeedbackDetails(items: item)));
} }
String getSelected(BuildContext context) {
switch (statusType) {
case StatusType.ComplaintNumber:
return TranslationBase.of(context).complaintNumber;
break;
case StatusType.FileNumber:
return TranslationBase.of(context).fileNumber;
break;
case StatusType.IdentificationNumber:
return TranslationBase.of(context).identificationNumber;
break;
}
return TranslationBase.of(context).notClassified;
}
}
enum StatusType {
ComplaintNumber,
FileNumber,
IdentificationNumber,
} }

@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget {
myRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic), myRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic),
SizedBox(height: 6), SizedBox(height: 6),
myRichText(TranslationBase.of(context).receiptOn, myRichText(TranslationBase.of(context).receiptOn,
DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn)) ?? "", projectViewModel.isArabic),
myRichText(TranslationBase.of(context).expiryOn, myRichText(TranslationBase.of(context).expiryOn,
DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate)) ?? "", projectViewModel.isArabic),
], ],
), ),
), ),
@ -101,8 +101,8 @@ class InsuranceApprovalDetail extends StatelessWidget {
TableRow( TableRow(
children: [ children: [
Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.procedureName ?? '', isLast: true, mProjectViewModel: projectViewModel), Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.procedureName ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(insuranceApprovalModel?.approvalStatusDescption ?? '', isLast: true, mProjectViewModel: projectViewModel), Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.status ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel), Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc ?? '', isLast: true, mProjectViewModel: projectViewModel),
], ],
), ),
]) ])

@ -43,7 +43,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
showNewAppBar: true, showNewAppBar: true,
baseViewModel: model, baseViewModel: model,
showNewAppBarTitle: true, showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).insuranceApproval, appBarTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
description: TranslationBase.of(context).infoApprovals, description: TranslationBase.of(context).infoApprovals,
infoList: TranslationBase.of(context).infoApprovalPoints, infoList: TranslationBase.of(context).infoApprovalPoints,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,

@ -36,7 +36,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
return BaseView<InsuranceViewModel>( return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsuranceUpdated(), onModelReady: (model) => model.getInsuranceUpdated(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
appBarTitle: TranslationBase.of(context).insurCards, appBarTitle: TranslationBase.of(context).updateInsurCards,
description: TranslationBase.of(context).infoInsurCards, description: TranslationBase.of(context).infoInsurCards,
infoList: TranslationBase.of(context).infoPrescriptionsPoints, infoList: TranslationBase.of(context).infoPrescriptionsPoints,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,

@ -53,7 +53,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
hmgServices.clear(); hmgServices.clear();
hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin)); hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin));
hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/visa.png", isLogin)); hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin));
hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin));
hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services2, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services2, "assets/images/new/emergency.svg", isLogin));

@ -102,13 +102,18 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
LocationUtils locationUtils; LocationUtils locationUtils;
Future<bool> onWillPop() { Future<bool> onWillPop() {
DateTime now = DateTime.now(); if (currentTab != 0) {
if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) { changeCurrentTab(0);
currentBackPressTime = now;
AppToast.showToast(message: TranslationBase.of(context).pressAgain);
return Future.value(false); return Future.value(false);
} else {
DateTime now = DateTime.now();
if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) {
currentBackPressTime = now;
AppToast.showToast(message: TranslationBase.of(context).pressAgain);
return Future.value(false);
}
return Future.value(true);
} }
return Future.value(true);
} }
changeCurrentTab(int tab) { changeCurrentTab(int tab) {
@ -168,19 +173,22 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// pageController.jumpToPage(tab); // pageController.jumpToPage(tab);
} else { } else {
if (currentTab > 0 && tab == 2) if (currentTab > 0 && tab == 2) {
pageController.jumpToPage(0); pageController.jumpToPage(0);
else if (tab != 0) { currentTab = tab;
} else if (tab != 0) {
if (tab == 4 && projectViewModel.isLogin && model.count == 0) { if (tab == 4 && projectViewModel.isLogin && model.count == 0) {
AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo); AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo);
} else { } else {
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
currentTab = tab;
} }
} else { } else {
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
currentTab = tab;
} }
currentTab = tab; // currentTab = tab;
} }
}); });
} }
@ -380,11 +388,12 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
); );
} }
showDialogs(String message) { // todo 'sikander' remove useless code
ConfirmDialog dialog = new ConfirmDialog( // showDialogs(String message) {
context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); // ConfirmDialog dialog = new ConfirmDialog(
dialog.showAlertDialog(context); // context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {});
} // dialog.showAlertDialog(context);
// }
Future<Map<Permission, PermissionStatus>> requestPermissions() async { Future<Map<Permission, PermissionStatus>> requestPermissions() async {
var permissionResults = [ var permissionResults = [
@ -396,7 +405,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// Permission.notification, // Permission.notification,
// Permission.accessMediaLocation, // Permission.accessMediaLocation,
// Permission.calendar, // Permission.calendar,
Permission.activityRecognition // Permission.activityRecognition
].request(); ].request();
// var permissionsGranted = await deviceCalendarPlugin.hasPermissions(); // var permissionsGranted = await deviceCalendarPlugin.hasPermissions();
@ -610,21 +619,28 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
changeCurrentTab(1); changeCurrentTab(1);
}, },
), ),
MedicalProfilePageNew(onTap: (){ MedicalProfilePageNew(
changeCurrentTab(0); onTap: () {
},), changeCurrentTab(0);
Search(onBackClick: (){ },
changeCurrentTab(0); ),
},), Search(
onBackClick: () {
changeCurrentTab(0);
},
),
MyFamily( MyFamily(
isAppbarVisible: false, isAppbarVisible: false,
onBackClick: () { onBackClick: () {
changeCurrentTab(0); changeCurrentTab(0);
}, },
), ),
ToDo(isShowAppBar: true,onBackClick: (){ ToDo(
changeCurrentTab(0); isShowAppBar: true,
},), onBackClick: () {
changeCurrentTab(0);
},
),
], // Please do not remove the BookingOptions from this array ], // Please do not remove the BookingOptions from this array
), ),
RobotIcon() RobotIcon()

@ -123,7 +123,7 @@ class LoggedSliderView extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.only(left: 20, right: 20), padding: const EdgeInsets.only(left: 20, right: 20),
child: Text( child: Text(
'${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime)} ,${projectViewModel.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user.age.toString() + "y"}', '${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime)} ,${projectViewModel.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user.age.toString() + " " + TranslationBase.of(context).patientAge.toString()}',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,

@ -64,8 +64,28 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
TabBar( TabBar(
labelColor: Colors.black, labelColor: Colors.black,
tabs: [ tabs: [
Tab(text: TranslationBase.of(context).consultation), Tab(
Tab(text: TranslationBase.of(context).logs), child: Text(
TranslationBase.of(context).consultation,
style: TextStyle(
color: Colors.black,
fontSize: 14,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
),
Tab(
child: Text(
TranslationBase.of(context).logs,
style: TextStyle(
color: Colors.black,
fontSize: 14,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
),
], ],
controller: _tabController, controller: _tabController,
), ),

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
@ -60,7 +61,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text(widget.erRequestHistoryList.sArrivalTime, style: TextStyle(fontSize: 14.0)), Text(DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.erRequestHistoryList.arrivalTime)), style: TextStyle(fontSize: 14.0)),
Text(TranslationBase.of(context).callDuration + "\n" + getCallTime(widget.erRequestHistoryList.callDuration), textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.grey[600])), Text(TranslationBase.of(context).callDuration + "\n" + getCallTime(widget.erRequestHistoryList.callDuration), textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.grey[600])),
], ],
), ),
@ -130,8 +131,8 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
Icon(Icons.star, size: 24.0, color: Colors.yellow[700]), Icon(Icons.star, size: 24.0, color: Colors.yellow[700]),
Container( Container(
width: MediaQuery.of(context).size.width * 0.2, width: MediaQuery.of(context).size.width * 0.2,
margin: EdgeInsets.only(left: 10.0), margin: EdgeInsets.only(left: 9.0),
child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)), child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 11.0)),
), ),
], ],
), ),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -38,7 +39,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
child: Container( child: Container(
height: 600.0, height: 600.0,
margin: EdgeInsets.all(20.0), margin: EdgeInsets.all(20.0),
width: 450.0, width: 500.0,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -81,10 +82,8 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
], ],
), ),
Container( Container(
alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 10.0, top: 10.0), margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Text(widget.clinicName, child: Text(widget.clinicName,
textAlign: TextAlign.center,
style: style:
TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
), ),
@ -194,21 +193,13 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
color: Colors.grey[400], color: Colors.grey[400],
), ),
Container( Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: new Text( child: new Text(
TranslationBase.of(context).upComingPayOption, TranslationBase.of(context).upComingPayOption,
textAlign: TextAlign.center,
style: new TextStyle(fontSize: 14.0), style: new TextStyle(fontSize: 14.0),
), ),
), ),
Container( Container(margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), child: getPaymentMethods()),
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0),
child: Image.asset(
"assets/images/new-design/payment_options_invoice_confirmation.png",
width: 300),
),
Divider( Divider(
thickness: 1.0, thickness: 1.0,
color: Colors.grey[400], color: Colors.grey[400],
@ -272,10 +263,9 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
return Container( return Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0), margin: EdgeInsets.only(top: 10.0, right: 10.0),
child: Text(text, child: Text(text,
textAlign: TextAlign.end, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
// fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
letterSpacing: 0.5, letterSpacing: 0.5,
color: Colors.black)), color: Colors.black)),
); );
@ -285,10 +275,9 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
return Container( return Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0, bottom: 10.0), margin: EdgeInsets.only(top: 10.0, right: 10.0, bottom: 10.0),
child: Text(text, child: Text(text,
textAlign: TextAlign.end, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
// fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
letterSpacing: 0.5, letterSpacing: 0.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black)), color: Colors.black)),

@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
@ -439,7 +440,7 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded isDataLoaded
? Container( ? Container(
height: MediaQuery.of(context).size.height * 0.7, height: MediaQuery.of(context).size.height * 0.7,
child: Column( child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0 ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
ListView.builder( ListView.builder(
@ -465,7 +466,7 @@ class _clinic_listState extends State<ClinicList> {
height: 10.0, height: 10.0,
), ),
], ],
), ): getNoDataWidget(context),
) )
: Container(), : Container(),
isDataLoaded isDataLoaded

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareHistoryCard.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareHistoryCard.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class LiveCareLogs extends StatefulWidget { class LiveCareLogs extends StatefulWidget {
@ -20,21 +21,20 @@ class _LiveCareLogsState extends State<LiveCareLogs> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: widget.erRequestHistoryList.length > 0
child: ListView.builder( ? Container(
scrollDirection: Axis.vertical, child: ListView.builder(
shrinkWrap: true, scrollDirection: Axis.vertical,
physics: ScrollPhysics(), shrinkWrap: true,
padding: EdgeInsets.all(0.0), physics: ScrollPhysics(),
itemCount: widget.erRequestHistoryList.length, padding: EdgeInsets.all(0.0),
itemBuilder: (context, index) { itemCount: widget.erRequestHistoryList.length,
return widget.erRequestHistoryList[index].callStatus < 4 itemBuilder: (context, index) {
? Container() return widget.erRequestHistoryList[index].callStatus < 4 ? Container() : LiveCareHistoryCard(erRequestHistoryList: widget.erRequestHistoryList[index]);
: LiveCareHistoryCard( },
erRequestHistoryList: widget.erRequestHistoryList[index]); ),
}, )
), : Container(margin: EdgeInsets.only(top: 200.0), child: getNoDataWidget(context)),
),
); );
} }
} }

@ -363,6 +363,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var request = this.getCommonRequest(type: type); var request = this.getCommonRequest(type: type);
request.sMSSignature = await SMSOTP.getSignature(); request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await this.authService.sendActivationCode(request).then((result) { await this.authService.sendActivationCode(request).then((result) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (result != null && result['isSMSSent'] == true) { if (result != null && result['isSMSSent'] == true) {
@ -535,8 +536,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false, result.list.isFamily = false,
userData = result.list, userData = result.list,
// sharedPref.setString( sharedPref.setString(BLOOD_TYPE, result.patientBloodType),
// BLOOD_TYPE, result['PatientBloodType']),
authenticatedUserObject.user = result.list, authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res), projectViewModel.setPrivilege(privilegeList: res),
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),

@ -308,7 +308,7 @@ class _Login extends State<Login> {
projectViewModel.setPrivilege(privilegeList: result); projectViewModel.setPrivilege(privilegeList: result);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
result.list.isFamily = false; result.list.isFamily = false;
// this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']), this.sharedPref.setString(BLOOD_TYPE, result.patientBloodType);
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(MAIN_USER, result.list); this.sharedPref.setObject(MAIN_USER, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);

@ -67,19 +67,14 @@ class _Register extends State<Register> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
MobileNo( MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
onNumberChange: (value) =>
{mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value),
Container( Container(
child: TextFields( child: TextFields(
controller: nationalIDorFile, controller: nationalIDorFile,
onChanged: (value) => validateForm(), onChanged: (value) => validateForm(),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
prefixIcon: Icon(Icons.chrome_reader_mode, prefixIcon: Icon(Icons.chrome_reader_mode, color: Color(0xFF40ACC9)),
color: Color(0xFF40ACC9)), padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).nationalID, hintText: TranslationBase.of(context).nationalID,
)), )),
Row( Row(
@ -120,33 +115,25 @@ class _Register extends State<Register> {
), ),
], ],
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
mainAxisAlignment: MainAxisAlignment.end, Container(
children: <Widget>[ width: SizeConfig.realScreenWidth * .9,
Container( height: 60,
width: SizeConfig.realScreenWidth * .9, child: isHijri == 1
height: 60, ? TextFields(
child: isHijri == 1 onChanged: (value) => {dob = value},
? TextFields( hintText: 'DD/MM/YYYY',
onChanged: (value) => {dob = value}, prefixIcon: Icon(Icons.date_range),
hintText: 'DD/MM/YYYY', )
prefixIcon: Icon(Icons.date_range), : RaisedButton.icon(
) shape: RoundedRectangleBorder(
: RaisedButton.icon( borderRadius: BorderRadius.circular(15.0),
shape: RoundedRectangleBorder( ),
borderRadius: BorderRadius.circular(15.0), color: Colors.white,
), onPressed: () => {if (isHijri != null) _selectDate(context)},
color: Colors.white, icon: Icon(Icons.date_range),
onPressed: () => { label: Text(selectedDate != null ? "${selectedDate.toLocal()}".split(' ')[0] : TranslationBase.of(context).dob)))
if (isHijri != null) ])
_selectDate(context)
},
icon: Icon(Icons.date_range),
label: Text(selectedDate != null
? "${selectedDate.toLocal()}"
.split(' ')[0]
: TranslationBase.of(context).dob)))
])
], ],
), ),
), ),
@ -165,13 +152,8 @@ class _Register extends State<Register> {
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(TranslationBase.of(context).registerNow, () => {startRegistration()},
TranslationBase.of(context).registerNow, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Colors.grey[900]))
() => {startRegistration()},
textColor: Colors.white,
color: isButtonDisabled == true
? Colors.grey
: Colors.grey[900]))
], ],
), ),
], ],
@ -181,11 +163,7 @@ class _Register extends State<Register> {
} }
Future<Null> _selectDate(BuildContext context) async { Future<Null> _selectDate(BuildContext context) async {
final DateTime picked = await showDatePicker( final DateTime picked = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: DateTime(1950, 8), lastDate: DateTime.now());
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1950, 8),
lastDate: DateTime.now());
if (picked != null && picked != selectedDate) if (picked != null && picked != selectedDate)
setState(() { setState(() {
selectedDate = picked; selectedDate = picked;
@ -193,30 +171,25 @@ class _Register extends State<Register> {
} }
startRegistration() { startRegistration() {
final DateFormat dateFormat = DateFormat('dd/MM/yyyy');
if (isButtonDisabled == false) { if (isButtonDisabled == false) {
var request = CheckPatientForRegistration(); var request = CheckPatientForRegistration();
request.patientMobileNumber = int.parse(mobileNo); request.patientMobileNumber = int.parse(mobileNo);
request.zipCode = countryCode; request.zipCode = countryCode;
request.patientOutSA = countryCode == '966' ? 0 : 1; request.patientOutSA = countryCode == '966' ? 0 : 1;
// if (this.loginType == 1) {
request.patientIdentificationID = int.parse(nationalIDorFile.text); request.patientIdentificationID = int.parse(nationalIDorFile.text);
request.patientID = 0; request.patientID = 0;
request.isRegister = true; request.isRegister = true;
// } else { request.dob = isHijri == 1 ? dob : dateFormat.format(selectedDate);
// request.patientIdentificationID = 0; request.isHijri = isHijri;
// request.patientID = int.parse(nationalIDorFile.text);
// }
this.checkPatientForRegisteration(request); this.checkPatientForRegisteration(request);
} }
} }
checkPatientForRegisteration(request) { checkPatientForRegisteration(request) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
this this.authService.checkPatientForRegisteration(request).then((response) => {checkUserStatus(response, request)}).catchError((err) {
.authService
.checkPatientForRegisteration(request)
.then((response) => {checkUserStatus(response, request)})
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
@ -233,10 +206,7 @@ class _Register extends State<Register> {
} }
void validateForm() { void validateForm() {
if (util.validateIDBox(nationalIDorFile.text, loginType) == true && if (util.validateIDBox(nationalIDorFile.text, loginType) == true && mobileNo.length >= 9 && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true && isHijri != null) {
mobileNo.length >= 9 &&
util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true &&
isHijri != null) {
setState(() { setState(() {
isButtonDisabled = false; isButtonDisabled = false;
}); });
@ -265,8 +235,7 @@ class _Register extends State<Register> {
} else { } else {
nRequest['forRegister'] = true; nRequest['forRegister'] = true;
nRequest['isRegister'] = true; nRequest['isRegister'] = true;
nRequest["PatientIdentificationID"] = nRequest["PatientIdentificationID"] = nRequest["PatientIdentificationID"].toString();
nRequest["PatientIdentificationID"].toString();
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest);
sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']); sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']);
this.chekUserData(response['LogInTokenID']); this.chekUserData(response['LogInTokenID']);
@ -312,12 +281,7 @@ class _Register extends State<Register> {
Navigator.of(context).push(FadePage(page: ConfirmLogin())), Navigator.of(context).push(FadePage(page: ConfirmLogin())),
} }
else else
{ {AppToast.showErrorToast(message: result ? result : TranslationBase.of(context).somethingWentWrong)}
AppToast.showErrorToast(
message: result
? result
: TranslationBase.of(context).somethingWentWrong)
}
}); });
} }

@ -16,6 +16,8 @@ class AllergiesPage extends StatelessWidget {
onModelReady: (model) => model.getAllergies(), onModelReady: (model) => model.getAllergies(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).allergies, appBarTitle: TranslationBase.of(context).allergies,
baseViewModel: model, baseViewModel: model,
description: TranslationBase.of(context).infoAllergies, description: TranslationBase.of(context).infoAllergies,

@ -67,70 +67,38 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getHospitals(), onModelReady: (model) => model.getHospitals(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
appBarTitle: TranslationBase.of(context).advancePayment, appBarTitle: TranslationBase.of(context).advancePayment,
description: TranslationBase.of(context).infoAdvancePayment, description: TranslationBase.of(context).infoAdvancePayment,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: Column(
physics: ScrollPhysics(), children: [
child: Container( Expanded(
margin: EdgeInsets.all(12), child: SingleChildScrollView(
child: Column( padding: EdgeInsets.all(21),
crossAxisAlignment: CrossAxisAlignment.start, physics: BouncingScrollPhysics(),
children: [ child: Column(
Text( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).advancePaymentLabel, mainAxisSize: MainAxisSize.min,
textAlign: TextAlign.center, children: [
style: TextStyle( Text(
fontSize: 14, TranslationBase.of(context).advancePaymentLabel,
fontWeight: FontWeight.w600, style: TextStyle(
letterSpacing: -0.46, fontSize: 14,
), fontWeight: FontWeight.w600,
), letterSpacing: -0.46,
SizedBox(
height: 12,
),
InkWell(
onTap: () => confirmSelectBeneficiaryDialog(model),
child: Container(
padding: EdgeInsets.all(8),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
getBeneficiaryType(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down)
],
), ),
), ),
),
if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
InkWell( InkWell(
onTap: () { onTap: () => confirmSelectBeneficiaryDialog(model),
GifLoaderDialogUtils.showMyDialog(context);
model.getFamilyFiles().then((value) {
GifLoaderDialogUtils.hideDialog(context);
confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList);
});
},
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
@ -138,42 +106,102 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
getFamilyMembersName(), getBeneficiaryType(),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.46, letterSpacing: -0.46,
), ),
), ),
Icon(Icons.arrow_drop_down), Icon(Icons.arrow_drop_down)
], ],
), ),
), ),
), ),
SizedBox( if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
height: 12, SizedBox(
), height: 12,
NewTextFields( ),
hintText: TranslationBase.of(context).fileNumber, if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
controller: _fileTextController, InkWell(
readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true, onTap: () {
), GifLoaderDialogUtils.showMyDialog(context);
if (beneficiaryType == BeneficiaryType.OtherAccount) model.getFamilyFiles().then((value) {
GifLoaderDialogUtils.hideDialog(context);
confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList);
});
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
getFamilyMembersName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
],
),
),
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).fileNumber,
controller: _fileTextController,
readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true,
),
if (beneficiaryType == BeneficiaryType.OtherAccount)
SizedBox(
height: 12,
),
if (beneficiaryType == BeneficiaryType.OtherAccount)
InkWell(
onTap: () {
if (_fileTextController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
model.getPatientInfoByPatientID(id: _fileTextController.text).then((value) {
GifLoaderDialogUtils.hideDialog(context);
confirmSelectPatientDialog(model.patientInfoList);
});
} else
AppToast.showErrorToast(message: 'Please Enter The File Number');
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
getPatientName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
],
),
),
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (beneficiaryType == BeneficiaryType.OtherAccount)
InkWell( InkWell(
onTap: () { onTap: () => confirmSelectHospitalDialog(model.hospitals),
if (_fileTextController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
model.getPatientInfoByPatientID(id: _fileTextController.text).then((value) {
GifLoaderDialogUtils.hideDialog(context);
confirmSelectPatientDialog(model.patientInfoList);
});
} else
AppToast.showErrorToast(message: 'Please Enter The File Number');
},
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
@ -183,7 +211,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
getPatientName(), getHospitalName(),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -195,132 +223,114 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
),
InkWell(
onTap: () => confirmSelectHospitalDialog(model.hospitals),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
getHospitalName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
],
),
), ),
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).amount,
keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
onChanged: (value) {
setState(() {
amount = value;
});
},
),
SizedBox(
height: 12,
),
if (model.user != null)
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorEmail, hintText: TranslationBase.of(context).amount,
initialValue: model.user.emailAddress, keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
onChanged: (value) { onChanged: (value) {
email = value; setState(() {
amount = value;
});
}, },
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( if (model.user != null)
hintText: TranslationBase.of(context).notes, NewTextFields(
controller: _notesTextController, hintText: TranslationBase.of(context).depositorEmail,
), initialValue: model.user.emailAddress,
SizedBox( onChanged: (value) {
height: MediaQuery.of(context).size.height * 0.15, email = value;
) },
], ),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).notes,
controller: _notesTextController,
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.15,
)
],
),
), ),
), ),
), Container(
bottomSheet: Container( color: Colors.white,
width: double.infinity, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
color: Theme.of(context).scaffoldBackgroundColor, child: DefaultButton(
padding: EdgeInsets.all(12), TranslationBase.of(context).submit,
child: DefaultButton( (amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null)
TranslationBase.of(context).submit, ? null
(amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null) ? null : : () {
() { var mobileNum;
var mobileNum; var patientName;
var patientName;
if (beneficiaryType == BeneficiaryType.MyFamilyFiles) { if (beneficiaryType == BeneficiaryType.MyFamilyFiles) {
mobileNum = selectedPatientFamily.mobileNumber; mobileNum = selectedPatientFamily.mobileNumber;
patientName = selectedPatientFamily.patientName; patientName = selectedPatientFamily.patientName;
} }
if (beneficiaryType == BeneficiaryType.MyAccount) {
mobileNum = model.user.mobileNumber;
patientName = model.user.firstName;
}
if (beneficiaryType == BeneficiaryType.OtherAccount) { if (beneficiaryType == BeneficiaryType.MyAccount) {
mobileNum = _selectedPatientInfo.mobileNumber; mobileNum = model.user.mobileNumber;
patientName = _selectedPatientInfo.fullName; patientName = model.user.firstName;
} }
advanceModel.fileNumber = _fileTextController.text; if (beneficiaryType == BeneficiaryType.OtherAccount) {
advanceModel.hospitalsModel = _selectedHospital; mobileNum = _selectedPatientInfo.mobileNumber;
advanceModel.note = _notesTextController.text; patientName = _selectedPatientInfo.fullName;
advanceModel.email = email ?? model.user.emailAddress;
advanceModel.amount = amount;
advanceModel.mobileNumber = mobileNum;
advanceModel.patientName = patientName;
GifLoaderDialogUtils.showMyDialog(context);
model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) {
Utils.hideKeyboard(context);
Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd) {
setState(() {});
} }
))).then(
(value) { advanceModel.fileNumber = _fileTextController.text;
Navigator.push( advanceModel.hospitalsModel = _selectedHospital;
context, advanceModel.note = _notesTextController.text;
FadePage( advanceModel.email = email ?? model.user.emailAddress;
page: ConfirmPaymentPage( advanceModel.amount = amount;
advanceModel: advanceModel, advanceModel.mobileNumber = mobileNum;
selectedPaymentMethod: value, advanceModel.patientName = patientName;
patientInfoAndMobileNumber: model.patientInfoAndMobileNumber, GifLoaderDialogUtils.showMyDialog(context);
authenticatedUser: authUser, model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) {
), GifLoaderDialogUtils.hideDialog(context);
), if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) {
); Utils.hideKeyboard(context);
Navigator.push(
context,
FadePage(
page: PaymentMethod(onSelectedMethod: (String metohd) {
setState(() {});
}),
),
).then(
(value) {
Navigator.push(
context,
FadePage(
page: ConfirmPaymentPage(
advanceModel: advanceModel,
selectedPaymentMethod: value,
patientInfoAndMobileNumber: model.patientInfoAndMobileNumber,
authenticatedUser: authUser,
),
),
);
},
);
}
});
}, },
); color: Color(0xffD02127),
} textColor: Colors.white,
}); disabledColor: Color(0xffEAEAEA),
}, ),
disabledColor: Colors.grey,
), ),
)), ],
),
),
); );
} }

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -190,15 +191,12 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
bottomSheet: Container( bottomSheet: Container(
color: Colors.white, color: Colors.white,
child: Container( child: Container(
height: MediaQuery.of(context).size.width * 0.18, // height: MediaQuery.of(context).size.width * 0.18,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(20),
child: SecondaryButton( child: DefaultButton(
textColor: Colors.white, TranslationBase.of(context).confirm.toUpperCase(),
color: CustomColors.accentColor, () {
label: TranslationBase.of(context).confirm.toUpperCase(),
disabled: model.state == ViewState.Busy,
onTap: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) { model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -50,7 +50,7 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
}, },
child: ListTile( child: ListTile(
title: Text( title: Text(
widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} KM', widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} ' + TranslationBase.of(context).km,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -90,7 +90,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
Row( Row(
children: [ children: [
Text( Text(
TranslationBase.of(context).fileNo + ":", TranslationBase.of(context).identificationNumber + ":",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 10, fontSize: 10,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save