diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json
index 3010ecd9..d39e8bd7 100644
--- a/assets/langs/ar-SA.json
+++ b/assets/langs/ar-SA.json
@@ -381,6 +381,12 @@
"clickHere": "انقر هنا",
"iAgreeToTheTermsAndConditions": "أوافق على الشروط والأحكام ",
"iAgreeToTheTermsAndConditionsSubtitle": "أوافق على الشروط والأحكام ",
+ "iAgreeAndAcceptTermsAndConditions": "أوافق وأقبل ",
+ "termsAndConditions": "الشروط والأحكام",
+ "iAgreeHealthInfoCanBeUsed": "أوافق على استخدام معلوماتي الصحية للمقابلة. مزيد من المعلومات في ",
+ "privacyPolicyText": "سياسة الخصوصية",
+ "outPatient": "العيادات الخارجيه",
+ "thisInvoiceIsNotEligibleForRefund": "هذه الفاتورة غير مؤهلة لاسترداد الأموال",
"save": "حفظ",
"userAgreement": "اتفاقية المستخدم",
"updateSuccessfully": "تم التحديث بنجاح",
@@ -677,11 +683,20 @@
"emrgNo": "رقم جهة الاتصال في حالات الطوارئ",
"modes": "الأوضاع",
"vibration": "اهتزاز عند اللمس",
- "blindModes": "أوضاع للمكفوفين جزئيًا",
+ "blindModes": "وضع للمكفوفين جزئياً",
"invertTheme": "عكس",
"offTheme": "إيقاف",
"dimTheme": "خافت",
"bwTheme": "أسود وأبيض",
+ "highContrastTheme": "تباين عالي",
+ "fontSize": "حجم الخط",
+ "fontSizeSmall": "صغير",
+ "fontSizeMedium": "متوسط",
+ "fontSizeLarge": "كبير",
+ "saveChanges": "حفظ التغييرات",
+ "settingsSavedSuccessfully": "تم حفظ الإعدادات بنجاح",
+ "cardHeading": "عنوان البطاقة",
+ "buttonText": "نص الزر",
"permissions": "إذن",
"cameraPermission": "الكاميرا",
"locationPermission": "الموقع",
@@ -689,7 +704,7 @@
"outOfStockMsg": "لقد أضفت منتجًا غير متوفر حاليًا، يرجى إزالته!",
"noArabicLetters": "لا يُسمح باستخدام الحروف العربية",
"noOffersAvailable": "لا توجد عروض متاحة!",
- "accessibility": "وضع الوصول",
+ "accessibility": "إمكانية الوصول",
"orderStatus": "حالة الطلب",
"findUs": "فروعنا",
"liveChat": "محادثة مباشرة",
@@ -1438,8 +1453,11 @@
"suggestions": "التوصيات",
"pleaseGoBackAndSelectOrgansFirst": "يرجى العودة واختيار الأعضاء أولاً",
"symptomsSelector": "محدد الأعراض",
- "possibleSymptomsRelatedTo": "أعراض مرتبطة بـ",
+ "possibleSymptomsRelatedTo": "الأعراض المحتملة المتعلقة بأعضاء محددة",
"suggestionAIListDescription": "هذه قائمة بالأعراض المقترحة من قبل الذكاء الاصطناعي، بناءً على المعلومات التي تم جمعها حتى الآن خلال المقابلة",
+ "whyAmIBeingAskedThis": "لماذا يُطرح علي هذا السؤال؟",
+ "weAreAskingThisQuestionToBetterUnderstand": "نطرح هذا السؤال لفهم {symptoms} بشكل أفضل وتحسين دقة التقييم.",
+ "analyzingYourSymptoms": "أعراضك",
"analyzing": "جاري التحليل...",
"seekMedicalAdvice": "اطلب المشورة الطبية",
"monitorDescription": "لا حاجة لطلب المشورة الطبية. فقط حافظ على روتين صحي.",
@@ -1458,6 +1476,30 @@
"areYouSureYouWantToExitProgress": "هل تود الخروج؟ ستفقد تقدمك الحالي.",
"noQuestionAvailable": "لا يوجد سؤال متاح",
"possibleSymptom": "تشخيص محتمل",
+ "triageLevelEmergencyAmbulance": "طوارئ - اتصل بالإسعاف",
+ "triageLevelEmergency": "طوارئ",
+ "triageLevelConsultation24": "استشارة خلال 24 ساعة",
+ "triageLevelConsultation": "استشارة طبية",
+ "triageLevelSelfCare": "رعاية ذاتية",
+ "triageLevelEmergencyAmbulanceDesc": "الأعراض المبلغ عنها خطيرة جدًا وقد تحتاج إلى رعاية طارئة. يجب عليك الاتصال بالإسعاف الآن.",
+ "triageLevelEmergencyDesc": "تبدو الأدلة المبلغ عنها خطيرة ويجب عليك الذهاب إلى قسم الطوارئ. إذا لم تتمكن من ال��صول إلى أقرب قسم طوارئ، اتصل بالإسعاف.",
+ "triageLevelConsultation24Desc": "يجب عليك زيارة الطبيب خلال 24 ساعة. إذا ساءت الأعراض فجأة، توجه إلى أقرب قسم طوارئ.",
+ "triageLevelConsultationDesc": "قد تحتاج إلى تقييم طبي وقد تحتاج إلى تحديد موعد مع طبيب. إذا ساءت الأعراض، راجع الطبيب على الفور.",
+ "triageLevelSelfCareDesc": "قد لا تتطلب الأعراض المعلنة تقييمًا طبيًا وعادة ما تزول من تلقاء نفسها. في بعض الأحيان يمكن علاجها من خلال طرق الرعاية الذاتية. راقب أعراضك واستشر الطبيب إذا ساءت الأعراض أو ظهرت أعراض جديدة.",
+ "rootCauseEmergencyEvidencePresent": "تم الإبلاغ عن دليل طوارئ",
+ "rootCauseSeriousEvidencePresent": "تم الإبلاغ عن دليل خطير",
+ "rootCauseEmergencyConditionLikely": "حالة تهدد الحياة محتملة",
+ "rootCauseEmergencyConditionPossible": "حالة تهدد الحياة ممكنة",
+ "rootCauseConsultationConditionLikely": "استشارة طبية مطلوبة",
+ "rootCauseSelfCareSufficient": "لا يوجد سبب محدد للتقييم الطبي",
+ "rootCauseDiagnosisUnknown": "التقييم غير ممكن",
+ "teleconsultationAvailable": "الاستشارة عن بُعد متاحة",
+ "seriousSymptoms": "أعراض خطيرة",
+ "howTo": "كيفية القياس؟",
+ "explainWhy": "اشرح، لماذا؟",
+ "whyThisCondition": "لماذا هذه الحالة؟",
+ "supportingEvidence": "الأدلة الداعمة",
+ "explanationDescription": "بناءً على الأعراض التي أبلغت عنها، تم تحديد هذه الحالة كتطابق محتمل. الأعراض التالية تدعم هذا التقييم:",
"symptomsCheckerFindingScore": "نسبة التطابق",
"notSet": "غير محدد",
"years": "سنوات",
@@ -1823,6 +1865,7 @@
"watchUsOnYoutube": "شاهدنا على يوتيوب",
"connectOnLinkedin": "تواصل معنا على لينكد إن",
"riskFactorPageTitle": "اعراض تشعر بها",
+ "doAnyOfTheseApply": "هل ينطبق عليك أي من هذه الأمور؟",
"bloodDonationService": "التبرع \n بالدم",
"bookAppointmentService": "حجز\nموعد",
"pinchToZoom": "اضغط للتكبير",
@@ -1892,6 +1935,10 @@
"refundReason6": "تم إلغاء الإجراء السريري أو تغييره من قِبل الطبيب المحيل",
"refundReason7": "تم إلغاء إجراء وحدة الخدمة / المختبر / الأشعة أو تغييره من قِبل الطبيب المحيل",
"selectProcedures": "اختر العمليات",
+ "beforeUsingSymptomsChecker": "قبل استخدام فاحص الأعراض، يرجى قراءة شروط الخدمة وتذكر:",
+ "symptomsCheckerNotDiagnosis": "• فاحص الأعراض ليس تشخيصًا. إنه للمعلومات الخاصة بك فقط وليس رأيًا طبيًا مؤهلاً.",
+ "symptomsCheckerNotEmergency": "• فاحص الأعراض ليس للطوارئ. اتصل برقم الطوارئ المحلي فورًا عند وجود حالة طوارئ صحية.",
+ "yourDataIsSafe": "• بياناتك آمنة. تضمن تدابير الخصوصية حماية المعلومات التي تشاركها.",
"submitEReferral": "تقديم الطلب",
"redeem": "استبدال",
"points": "نقاط",
@@ -1907,7 +1954,8 @@
"advanceNumber": "رقم الدفعة المقدمة",
"amountOnly": "المبلغ",
"invoiceHistory": "سجل الفواتير",
- "thisInvoiceIsNotEligibleForRefund": "هذه الفاتورة غير مؤهلة للاسترداد",
+ "refund": "استرداد",
+ "invoiceHistory": "سجل الفواتير",
"refund": "استرداد",
"parkingQR": "رمز الاستجابة السريعة لوقوف السيارات",
"parkingQRDesc": "امسح رمز الاستجابة السريعة (QR Code) أدناه عند بوابة الخروج من موقف السيارات:"
diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json
index 94de68ed..61a6da03 100644
--- a/assets/langs/en-US.json
+++ b/assets/langs/en-US.json
@@ -377,6 +377,12 @@
"clickHere": "Click here",
"iAgreeToTheTermsAndConditions": "I agree to the terms and conditions ",
"iAgreeToTheTermsAndConditionsSubtitle": "I agree to the terms and conditions ",
+ "iAgreeAndAcceptTermsAndConditions": "I agree and accept ",
+ "termsAndConditions": "Terms and Conditions",
+ "iAgreeHealthInfoCanBeUsed": "I agree that my health information can be used for the interview. More information in the ",
+ "privacyPolicyText": "Privacy Policy",
+ "outPatient": "Out Patient",
+ "thisInvoiceIsNotEligibleForRefund": "This invoice is not eligible for refund",
"save": "Save",
"userAgreement": "User Agreement",
"updateSuccessfully": "Update Successfully",
@@ -667,11 +673,20 @@
"emrgNo": "Emergency Contact Number",
"modes": "Modes",
"vibration": "Vibration Touch Feedback",
- "blindModes": "Modes for Partially Blind",
+ "blindModes": "Mode for partially blind",
"invertTheme": "Invert",
"offTheme": "Off",
"dimTheme": "Dim",
"bwTheme": "Black and White",
+ "highContrastTheme": "High Contrast",
+ "fontSize": "Font Size",
+ "fontSizeSmall": "Small",
+ "fontSizeMedium": "Medium",
+ "fontSizeLarge": "Large",
+ "saveChanges": "Save Changes",
+ "settingsSavedSuccessfully": "Settings saved successfully",
+ "cardHeading": "Card Heading",
+ "buttonText": "Button Text",
"permissions": "Permission",
"cameraPermission": "Camera",
"locationPermission": "Location",
@@ -679,7 +694,7 @@
"outOfStockMsg": "You have added product which is out of stock now, Please remove that!",
"noArabicLetters": "It Is Not Allow to Use Arabic Letters",
"noOffersAvailable": "No Offers Available!",
- "accessibility": "Accessibility Mode",
+ "accessibility": "Accessibility",
"orderStatus": "Order Status",
"findUs": "Find Us",
"liveChat": "Live Chat",
@@ -1430,8 +1445,11 @@
"suggestions": "Suggestions",
"pleaseGoBackAndSelectOrgansFirst": "Please go back and select organs first",
"symptomsSelector": "Symptoms Selector",
- "possibleSymptomsRelatedTo": "Possible symptoms related to",
+ "possibleSymptomsRelatedTo": "Possible symptoms related to selected organs",
"suggestionAIListDescription": "This is a list of symptoms suggested by our AI, based on the information gathered so far during the interview",
+ "whyAmIBeingAskedThis": "Why am I being asked this?",
+ "weAreAskingThisQuestionToBetterUnderstand": "We are asking this question to better understand your {symptoms} and improve the accuracy of the assessment.",
+ "analyzingYourSymptoms": "your symptoms",
"analyzing": "Analyzing...",
"seekMedicalAdvice": "Seek Medical Advice",
"monitorDescription": "No need to seek medical advice. Just keep healthy routine.",
@@ -1450,6 +1468,30 @@
"areYouSureYouWantToExitProgress": "Are you sure you want to exit? Your progress will be lost.",
"noQuestionAvailable": "No question available",
"possibleSymptom": "Possible symptom: ",
+ "triageLevelEmergencyAmbulance": "Emergency - Call Ambulance",
+ "triageLevelEmergency": "Emergency",
+ "triageLevelConsultation24": "Consultation Within 24 Hours",
+ "triageLevelConsultation": "Medical Consultation",
+ "triageLevelSelfCare": "Self-Care",
+ "triageLevelEmergencyAmbulanceDesc": "The reported symptoms are very serious and you may require emergency care. You should call an ambulance right now.",
+ "triageLevelEmergencyDesc": "The reported evidence appears serious and you should go to an emergency department. If you can't get to the nearest emergency department, call an ambulance.",
+ "triageLevelConsultation24Desc": "You should see a doctor within 24 hours. If the symptoms suddenly get worse, go to the nearest emergency department.",
+ "triageLevelConsultationDesc": "You may require medical evaluation and may need to schedule an appointment with a doctor. If the symptoms get worse, see a doctor immediately.",
+ "triageLevelSelfCareDesc": "The declared symptoms may not require a medical evaluation and they usually resolve on their own. Sometimes they can be treated through self-care methods. Observe your symptoms and consult a doctor if the symptoms get worse or new ones appear.",
+ "rootCauseEmergencyEvidencePresent": "Emergency evidence reported",
+ "rootCauseSeriousEvidencePresent": "Serious evidence reported",
+ "rootCauseEmergencyConditionLikely": "Life-threatening condition likely",
+ "rootCauseEmergencyConditionPossible": "Life-threatening condition possible",
+ "rootCauseConsultationConditionLikely": "Medical consultation required",
+ "rootCauseSelfCareSufficient": "No identified reason for medical evaluation",
+ "rootCauseDiagnosisUnknown": "Assessment not possible",
+ "teleconsultationAvailable": "Teleconsultation Available",
+ "seriousSymptoms": "Serious Symptoms",
+ "howTo": "How to?",
+ "explainWhy": "Explain, Why?",
+ "whyThisCondition": "Why this condition?",
+ "supportingEvidence": "Supporting Evidence",
+ "explanationDescription": "Based on your reported symptoms, this condition has been identified as a possible match. The following symptoms support this assessment:",
"symptomsCheckerFindingScore": "- Symptoms checker finding score",
"notSet": "Not set",
"years": "Years",
@@ -1815,6 +1857,7 @@
"watchUsOnYoutube": "Watch us on youtube",
"connectOnLinkedin": "Connect on LinkedIn",
"riskFactorPageTitle": "What do you feel?",
+ "doAnyOfTheseApply": "Do any of these apply to you?",
"bloodDonationService": "Blood \nDonation",
"bookAppointmentService": "Book\nAppointment",
"pinchToZoom": "Pinch to zoom",
@@ -1884,6 +1927,10 @@
"refundReason6": "Clinical procedure cancelled or changed by requesting doctor",
"refundReason7": "Service unit/lab/radiology procedure cancelled or changed by requesting doctor",
"selectProcedures": "Select Procedures",
+ "beforeUsingSymptomsChecker": "Before using the Symptoms Checker, please read the Terms of Service and remember:",
+ "symptomsCheckerNotDiagnosis": "• Symptoms Checker isn't a diagnosis. It's only for your information and not a qualified medical opinion.",
+ "symptomsCheckerNotEmergency": "• Symptoms Checker isn't for emergencies. Call your local emergency number right away when there's a health emergency.",
+ "yourDataIsSafe": "• Your data is safe. Privacy measures ensure the information you share is protected.",
"redeem": "Redeem",
"points": "Points",
"transactions": "Transactions",
@@ -1892,7 +1939,6 @@
"earned": "Earned",
"getParkingQR": "Get Parking QR",
"cannotOpenThisFile": "Cannot open this file",
- "thisInvoiceIsNotEligibleForRefund": "This invoice is not eligible for refund",
"refundDetails": "Refund Details",
"requestNo": "Request No.",
"referenceNo": "Reference No.",
@@ -1902,7 +1948,6 @@
"invoiceHistory": "Invoice History",
"parkingQR": "Parking QR Code",
"parkingQRDesc": "Scan the below QR Code at the exit parking gate:"
-
}
diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart
index 7e5b42ff..50fe4fe3 100644
--- a/lib/core/api/api_client.dart
+++ b/lib/core/api/api_client.dart
@@ -208,7 +208,7 @@ class ApiClientImp implements ApiClient {
if (url == 'https://uat.hmgwebservices.com/Services/NHIC.svc/REST/GetPatientInfo') {
url = "https://hmgwebservices.com/Services/NHIC.svc/REST/GetPatientInfo";
body['TokenID'] = "@dm!n";
- }
+ }
body['TokenID'] = "@dm!n";
body['PatientID'] = 4774598;
@@ -260,7 +260,7 @@ class ApiClientImp implements ApiClient {
body: requestBody,
headers: headers,
);
- // log("response: ${response.body.toString()}");
+ log("response: ${response.body.toString()}");
} on SocketException catch (e) {
final message = e.message.contains('Connection reset by peer') ? LocaleKeys.networkConnectionReset.tr() : LocaleKeys.networkErrorMessage.tr();
onFailure(message, -1, failureType: ConnectivityFailure(message));
diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart
index fbab6486..aa51a5da 100644
--- a/lib/core/api_consts.dart
+++ b/lib/core/api_consts.dart
@@ -13,7 +13,7 @@ class ApiConsts {
static String rcBaseUrl = 'https://rc.hmg.com/'; // dRC API URL PROD
static String hmgPharmacyApiBaseUrl = 'https://hmgpharmacyapi.hmg.com/'; // symptoms API URL PROD
- static String symptomsCheckerApiUAT = '${hmgPharmacyApiBaseUrl}symptomsapi/api/SymptomChecker'; // dRC API URL PROD
+ static String symptomsCheckerApiUAT = '${hmgPharmacyApiBaseUrl}symptomsapi_live/api/SymptomChecker'; // dRC API URL PROD
static String symptomsCheckerApiLive = '${hmgPharmacyApiBaseUrl}symptomsapi_live/api/SymptomChecker'; // dRC API URL PROD
static String symptomsCheckerApi = '${hmgPharmacyApiBaseUrl}symptomsapi_live/api/SymptomChecker'; // dRC API URL PROD
static String symptomsCheckerScheduleAppointment = '$symptomsCheckerApi/ScheduleAppointment';
@@ -219,6 +219,9 @@ class ApiConsts {
static final String diagnosis = '$symptomsCheckerApi/GetDiagnosis';
static final String explain = '$symptomsCheckerApi/ExplainDiagnosisResult';
static final String getClinicFromCondition = '$symptomsCheckerApi/GetClinicsByCondition?condition=';
+ static final String getRationale = '$symptomsCheckerApi/GetRationale';
+ static final String getTriage = '$symptomsCheckerApi/GetTriage';
+ static final String getExplanations = '$symptomsCheckerApi/GetExplanations';
//E-REFERRAL SERVICES
static final getAllRelationshipTypes = "Services/Patients.svc/REST/GetAllRelationshipTypes";
@@ -1021,33 +1024,9 @@ class ApiKeyConstants {
static final String googleMapsApiKey = 'AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng';
}
-//flutter: URL : https://hmgwebservices.com/Services/H2ORemainder.svc/REST/H2O_InsertUserActivity
-// flutter: {"IdentificationNo":"2530976584","MobileNumber":"504278212","QuantityIntake":200,"VersionID":20.0,"Channel":3,"LanguageID":2,"IPAdress":"10.20.10.20","generalid":"Cs2020@2016$2958","PatientOutSA":0,"SessionID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","isDentalAllowedBackend":false,"DeviceTypeID":1,"PatientID":4515697,"TokenID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","PatientTypeID":1,"PatientType":1,"Latitude":37.785834,"Longitude":-122.406417}
-// flutter: response.body:
-// flutter: {"Date":null,"LanguageID":0,"ServiceName":0,"Time":null,"AndroidLink":null,"AuthenticationTokenID":null,"Data":null,"Dataw":false,"DietType":0,"DietTypeID":0,"ErrorCode":null,"ErrorEndUserMessage":null,"ErrorEndUserMessageN":null,"ErrorMessage":null,"ErrorStatusCode":0,"ErrorType":0,"FoodCategory":0,"IOSLink":null,"IsAuthenticated":true,"MealOrderStatus":0,"MealType":0,"MessageStatus":1,"NumberOfResultRecords":0,"PatientBlodType":null,"SuccessMsg":null,"SuccessMsgN":null,"VidaUpdatedResponse":null,"IsHMGPatient":false,"LogInTokenID":null,"PhysicalActivityData":null,"RowExists":0,"UserDetailData":null,"UserDetailData_New":null,"UserProgressForMonthData":null,"UserProgressForTodayData":[{"QuantityConsumed":200.00,"PercentageConsumed":9.41,"PercentageLeft":90.59,"QuantityLimit":2125.00}],"UserProgressForWeekData":null,"UserProgressHistoryData":[{"Quantity":200.000,"CreatedDate":"\/Date(1766911222217+0300)\/"}],"VerificationCode":null,"isSMSSent":false}
-
-// URL : https://hmgwebservices.com/Services/H2ORemainder.svc/REST/H2o_UndoUserActivity
-// flutter: {"Progress":1,"MobileNumber":"504278212","IdentificationNo":"2530976584","VersionID":20.0,"Channel":3,"LanguageID":2,"IPAdress":"10.20.10.20","generalid":"Cs2020@2016$2958","PatientOutSA":0,"SessionID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","isDentalAllowedBackend":false,"DeviceTypeID":1,"PatientID":4515697,"TokenID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","PatientTypeID":1,"PatientType":1,"Latitude":37.785834,"Longitude":-122.406417}
-// flutter: response.body:
-// flutter: {"Date":null,"LanguageID":0,"ServiceName":0,"Time":null,"AndroidLink":null,"AuthenticationTokenID":null,"Data":null,"Dataw":false,"DietType":0,"DietTypeID":0,"ErrorCode":null,"ErrorEndUserMessage":null,"ErrorEndUserMessageN":null,"ErrorMessage":null,"ErrorStatusCode":0,"ErrorType":0,"FoodCategory":0,"IOSLink":null,"IsAuthenticated":false,"MealOrderStatus":0,"MealType":0,"MessageStatus":1,"NumberOfResultRecords":0,"PatientBlodType":null,"SuccessMsg":null,"SuccessMsgN":null,"VidaUpdatedResponse":null,"IsHMGPatient":false,"LogInTokenID":null,"PhysicalActivityData":null,"RowExists":0,"UserDetailData":null,"UserDetailData_New":null,"UserProgressForMonthData":null,"UserProgressForTodayData":[{"QuantityConsumed":0.00,"PercentageConsumed":0.00,"PercentageLeft":100.00,"QuantityLimit":2125.00}],"UserProgressForWeekData":null,"UserProgressHistoryData":[],"VerificationCode":null,"isSMSSent":false}
-
-// Progress":2 means weekly data
-
-// flutter: URL : https://hmgwebservices.com/Services/H2ORemainder.svc/REST/H2O_GetUserProgress
-// flutter: {"Progress":2,"MobileNumber":"504278212","IdentificationNo":"2530976584","VersionID":20.0,"Channel":3,"LanguageID":2,"IPAdress":"10.20.10.20","generalid":"Cs2020@2016$2958","PatientOutSA":0,"SessionID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","isDentalAllowedBackend":false,"DeviceTypeID":1,"PatientID":4515697,"TokenID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","PatientTypeID":1,"PatientType":1,"Latitude":37.785834,"Longitude":-122.406417}
-// flutter: response.body:
-// [log] {"Date":null,"LanguageID":0,"ServiceName":0,"Time":null,"AndroidLink":null,"AuthenticationTokenID":null,"Data":null,"Dataw":false,"DietType":0,"DietTypeID":0,"ErrorCode":null,"ErrorEndUserMessage":null,"ErrorEndUserMessageN":null,"ErrorMessage":null,"ErrorStatusCode":0,"ErrorType":0,"FoodCategory":0,"IOSLink":null,"IsAuthenticated":false,"MealOrderStatus":0,"MealType":0,"MessageStatus":1,"NumberOfResultRecords":0,"PatientBlodType":null,"SuccessMsg":null,"SuccessMsgN":null,"VidaUpdatedResponse":null,"IsHMGPatient":false,"LogInTokenID":null,"PhysicalActivityData":null,"RowExists":0,"UserDetailData":null,"UserDetailData_New":null,"UserProgressForMonthData":null,"UserProgressForTodayData":null,"UserProgressForWeekData":[{"DayNumber":1,"DayDate":null,"DayName":"Sunday","PercentageConsumed":0},{"DayNumber":7,"DayDate":null,"DayName":"Saturday","PercentageConsumed":0},{"DayNumber":6,"DayDate":null,"DayName":"Friday","PercentageConsumed":0},{"DayNumber":5,"DayDate":null,"DayName":"Thursday","PercentageConsumed":0},{"DayNumber":4,"DayDate":null,"DayName":"Wednesday","PercentageConsumed":0},{"DayNumber":3,"DayDate":null,"DayName":"Tuesday","PercentageConsumed":0},{"DayNumber":2,"DayDate":null,"DayName":"Monday","PercentageConsumed":0}],"UserProgressHistoryData":[],"VerificationCode":null,"isSMSSent":false}
-
-// Progress":1 means daily data
-
-//URL : https://hmgwebservices.com/Services/H2ORemainder.svc/REST/H2O_GetUserProgress
-// flutter: {"Progress":1,"MobileNumber":"504278212","IdentificationNo":"2530976584","VersionID":20.0,"Channel":3,"LanguageID":2,"IPAdress":"10.20.10.20","generalid":"Cs2020@2016$2958","PatientOutSA":0,"SessionID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","isDentalAllowedBackend":false,"DeviceTypeID":1,"PatientID":4515697,"TokenID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","PatientTypeID":1,"PatientType":1,"Latitude":37.785834,"Longitude":-122.406417}
-// flutter: response.body:
-// flutter: {"Date":null,"LanguageID":0,"ServiceName":0,"Time":null,"AndroidLink":null,"AuthenticationTokenID":null,"Data":null,"Dataw":false,"DietType":0,"DietTypeID":0,"ErrorCode":null,"ErrorEndUserMessage":null,"ErrorEndUserMessageN":null,"ErrorMessage":null,"ErrorStatusCode":0,"ErrorType":0,"FoodCategory":0,"IOSLink":null,"IsAuthenticated":false,"MealOrderStatus":0,"MealType":0,"MessageStatus":1,"NumberOfResultRecords":0,"PatientBlodType":null,"SuccessMsg":null,"SuccessMsgN":null,"VidaUpdatedResponse":null,"IsHMGPatient":false,"LogInTokenID":null,"PhysicalActivityData":null,"RowExists":0,"UserDetailData":null,"UserDetailData_New":null,"UserProgressForMonthData":null,"UserProgressForTodayData":[{"QuantityConsumed":0.00,"PercentageConsumed":0.00,"PercentageLeft":100.00,"QuantityLimit":2125.00}],"UserProgressForWeekData":null,"UserProgressHistoryData":[],"VerificationCode":null,"isSMSSent":false}
-
-// Progress":1 means monthly data
-
-// flutter: URL : https://hmgwebservices.com/Services/H2ORemainder.svc/REST/H2O_GetUserProgress
-// flutter: {"Progress":3,"MobileNumber":"504278212","IdentificationNo":"2530976584","VersionID":20.0,"Channel":3,"LanguageID":2,"IPAdress":"10.20.10.20","generalid":"Cs2020@2016$2958","PatientOutSA":0,"SessionID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","isDentalAllowedBackend":false,"DeviceTypeID":1,"PatientID":4515697,"TokenID":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOjIsIm9iaiI6eyJUaW1lIjoiMjAyNS0xMi0yOFQwODozNjo0My45MTY0MzRaIiwiUGF0aWVudElEIjoiNDUxNTY5NyIsIlBhdGllbnRNZXJnZWRJRHMiOiI0NTE1Njk3IiwiUGF0aWVudE91dFNBIjpmYWxzZX0sImV4cCI6MTc2Njk2NjQwMH0.l1rCcs2OAU5u2J-iZMiO7NX6shGzLJV0hlYtVh2JeqY","PatientTypeID":1,"PatientType":1,"Latitude":37.785834,"Longitude":-122.406417}
-// flutter: response.body:
-// [log] {"Date":null,"LanguageID":0,"ServiceName":0,"Time":null,"AndroidLink":null,"AuthenticationTokenID":null,"Data":null,"Dataw":false,"DietType":0,"DietTypeID":0,"ErrorCode":null,"ErrorEndUserMessage":null,"ErrorEndUserMessageN":null,"ErrorMessage":null,"ErrorStatusCode":0,"ErrorType":0,"FoodCategory":0,"IOSLink":null,"IsAuthenticated":false,"MealOrderStatus":0,"MealType":0,"MessageStatus":1,"NumberOfResultRecords":0,"PatientBlodType":null,"SuccessMsg":null,"SuccessMsgN":null,"VidaUpdatedResponse":null,"IsHMGPatient":false,"LogInTokenID":null,"PhysicalActivityData":null,"RowExists":0,"UserDetailData":null,"UserDetailData_New":null,"UserProgressForMonthData":[{"MonthNumber":1,"MonthName":"January","PercentageConsumed":0},{"MonthNumber":2,"MonthName":"February","PercentageConsumed":0},{"MonthNumber":3,"MonthName":"March","PercentageConsumed":0},{"MonthNumber":4,"MonthName":"April","PercentageConsumed":0},{"MonthNumber":5,"MonthName":"May","PercentageConsumed":0},{"MonthNumber":6,"MonthName":"June","PercentageConsumed":0},{"MonthNumber":7,"MonthName":"July","PercentageConsumed":0},{"MonthNumber":8,"MonthName":"August","PercentageConsumed":0},{"MonthNumber":9,"MonthName":"September","PercentageConsumed":0},{"MonthNumber":10,"MonthName":"October","PercentageConsumed":0},{"MonthNumber":11,"MonthName":"November","PercentageConsumed":0},{"MonthNumber":12,"MonthName":"December","PercentageConsumed":0}],"UserProgressForTodayData":null,"UserProgressForWeekData":null,"UserProgressHistoryData":[],"VerificationCode":null,"isSMSSent":false}
+class AppUrls {
+ static final hmgTermsUrlEn = 'https://hmg.com/en/Pages/Terms.aspx';
+ static final hmgPrivacyUrlEn = 'https://hmg.com/en/Pages/Privacy.aspx';
+ static final hmgTermsUrlAr = 'https://hmg.com/ar/Pages/Terms.aspx';
+ static final hmgPrivacyUrlAr = 'https://hmg.com/ar/Pages/Privacy.aspx';
+}
diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart
index 35532d69..9e8a044d 100644
--- a/lib/core/utils/utils.dart
+++ b/lib/core/utils/utils.dart
@@ -26,6 +26,8 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/dialogs/confirm_dialog.dart';
import 'package:hmg_patient_app_new/widgets/loading_dialog.dart';
+import 'package:hmg_patient_app_new/widgets/accessibility/preserve_image_colors.dart';
+import 'package:hmg_patient_app_new/widgets/accessibility/preserve_svg_colors.dart';
import 'package:lottie/lottie.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -120,10 +122,8 @@ class Utils {
// ),
// ));
return !isAddHours
- ? DateFormat('hh:mm a', appState.isArabic() ? "ar_SA" : "en_US")
- .format(DateTime.tryParse(startTime.contains("T") ? startTime : convertStringToDateTime(startTime))!.toLocal())
- : DateFormat('hh:mm a', appState.isArabic() ? "ar_SA" : "en_US")
- .format(DateTime.tryParse(startTime.contains("T") ? startTime : convertStringToDateTime(startTime))!.add(
+ ? DateFormat('hh:mm a', appState.isArabic() ? "ar_SA" : "en_US").format(DateTime.tryParse(startTime.contains("T") ? startTime : convertStringToDateTime(startTime))!.toLocal())
+ : DateFormat('hh:mm a', appState.isArabic() ? "ar_SA" : "en_US").format(DateTime.tryParse(startTime.contains("T") ? startTime : convertStringToDateTime(startTime))!.add(
Duration(
hours: isAddHours ? 3 : 0,
),
@@ -356,12 +356,9 @@ class Utils {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: isSmallWidget ? 0.h : 48.h),
- Lottie.asset(AppAnimations.noData,
- repeat: false, reverse: false, frameRate: FrameRate(60), width: width.w, height: height.h, fit: BoxFit.fill),
+ Lottie.asset(AppAnimations.noData, repeat: false, reverse: false, frameRate: FrameRate(60), width: width.w, height: height.h, fit: BoxFit.fill),
SizedBox(height: 16.h),
- (noDataText ?? LocaleKeys.noDataAvailable.tr())
- .toText14(isBold: true, color: AppColors.greyTextColor, isCenter: true)
- .paddingSymmetrical(64.w, 0.h),
+ (noDataText ?? LocaleKeys.noDataAvailable.tr()).toText14(isBold: true, color: AppColors.greyTextColor, isCenter: true).paddingSymmetrical(64.w, 0.h),
SizedBox(height: 16.h),
callToActionButton
],
@@ -373,8 +370,7 @@ class Utils {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
- Lottie.asset(AppAnimations.loadingAnimation,
- repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill),
+ Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill),
SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor, isCenter: true, isBold: true),
SizedBox(height: 8.h),
@@ -400,8 +396,7 @@ class Utils {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
- Lottie.asset(AppAnimations.errorAnimation,
- repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
+ Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 8.h),
@@ -502,8 +497,7 @@ class Utils {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
- Lottie.asset(AppAnimations.warningAnimation,
- repeat: false, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
+ Lottie.asset(AppAnimations.warningAnimation, repeat: false, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText15(color: AppColors.blackColor, letterSpacing: 0),
SizedBox(height: 16.h),
@@ -623,10 +617,8 @@ class Utils {
}
// Replace HTML line breaks with newlines
- var withLineBreaks = htmlString
- .replaceAll(RegExp(r'
', multiLine: true), '\n')
- .replaceAll(RegExp(r'<\/p>', multiLine: true), '\n')
- .replaceAll(RegExp(r'', multiLine: true), '\n');
+ var withLineBreaks =
+ htmlString.replaceAll(RegExp(r'
', multiLine: true), '\n').replaceAll(RegExp(r'<\/p>', multiLine: true), '\n').replaceAll(RegExp(r'', multiLine: true), '\n');
// Remove all other HTML tags
var withoutTags = withLineBreaks.replaceAll(RegExp(r'<[^>]*>'), '');
@@ -704,20 +696,7 @@ class Utils {
final year = parts[0];
// Map month number to short month name (Hijri months)
- const hijriMonthNames = [
- 'Muharram',
- 'Safar',
- 'Rabi I',
- 'Rabi II',
- 'Jumada I',
- 'Jumada II',
- 'Rajab',
- 'Sha\'ban',
- 'Ramadan',
- 'Shawwal',
- 'Dhu al-Qi\'dah',
- 'Dhu al-Hijjah'
- ];
+ const hijriMonthNames = ['Muharram', 'Safar', 'Rabi I', 'Rabi II', 'Jumada I', 'Jumada II', 'Rajab', 'Sha\'ban', 'Ramadan', 'Shawwal', 'Dhu al-Qi\'dah', 'Dhu al-Hijjah'];
final monthIndex = int.tryParse(parts[1]) ?? 1;
final month = hijriMonthNames[monthIndex - 1];
@@ -774,21 +753,23 @@ class Utils {
String? errorAsset,
}) {
final Color? resolvedColor = iconColor ?? (applyThemeColor && AppColors.isDarkMode ? AppColors.textColor : null);
- return SvgPicture.asset(
- icon,
- colorFilter: resolvedColor != null ? ColorFilter.mode(isDisabled ? resolvedColor.withOpacity(0.5) : resolvedColor, BlendMode.srcIn) : null,
- width: width,
- height: height,
- fit: fit,
- errorBuilder: errorAsset != null
- ? (context, error, stackTrace) => SvgPicture.asset(
- errorAsset,
- colorFilter: resolvedColor != null ? ColorFilter.mode(isDisabled ? resolvedColor.withOpacity(0.5) : resolvedColor, BlendMode.srcIn) : null,
- width: width,
- height: height,
- fit: fit,
- )
- : null,
+ return PreserveSvgColors(
+ child: SvgPicture.asset(
+ icon,
+ colorFilter: resolvedColor != null ? ColorFilter.mode(isDisabled ? resolvedColor.withValues(alpha: 0.5) : resolvedColor, BlendMode.srcIn) : null,
+ width: width,
+ height: height,
+ fit: fit,
+ errorBuilder: errorAsset != null
+ ? (context, error, stackTrace) => SvgPicture.asset(
+ errorAsset,
+ colorFilter: resolvedColor != null ? ColorFilter.mode(isDisabled ? resolvedColor.withValues(alpha: 0.5) : resolvedColor, BlendMode.srcIn) : null,
+ width: width,
+ height: height,
+ fit: fit,
+ )
+ : null,
+ ),
);
}
@@ -802,14 +783,16 @@ class Utils {
}) {
final iconH = height ?? 24.h;
final iconW = width ?? 24.w;
- return SvgPicture.network(
- url,
- colorFilter: ColorFilter.mode(
- isDisabled ? iconColor.withOpacity(0.5) : iconColor,
- BlendMode.srcIn,
+ return PreserveSvgColors(
+ child: SvgPicture.network(
+ url,
+ colorFilter: ColorFilter.mode(
+ isDisabled ? iconColor.withValues(alpha: 0.5) : iconColor,
+ BlendMode.srcIn,
+ ),
+ width: iconW,
+ height: iconH,
),
- width: iconW,
- height: iconH,
);
}
@@ -825,14 +808,15 @@ class Utils {
}) {
final iconH = height ?? 24.h;
final iconW = width ?? 24.w;
- return Container(
- decoration: BoxDecoration(
- border: border != null ? Border.all(color: AppColors.whiteColor, width: border) : null,
- borderRadius: border != null ? BorderRadius.circular(borderRadius ?? 12.r) : null,
+ return PreserveImageColors(
+ child: Container(
+ decoration: BoxDecoration(
+ border: border != null ? Border.all(color: AppColors.whiteColor, width: border) : null,
+ borderRadius: border != null ? BorderRadius.circular(borderRadius ?? 12.r) : null,
+ ),
+ child: Image.asset(icon, width: iconW, height: iconH, fit: fit),
),
- child: Image.asset(icon, width: iconW, height: iconH, fit: fit),
);
- // return Image.asset(icon, width: width, height: height, fit: fit, );
}
static Widget buildImgWithAssetsWithBorderRadius({
@@ -847,21 +831,23 @@ class Utils {
}) {
final iconH = height ?? 24.h;
final iconW = width ?? 24.w;
- return Container(
- width: iconW,
- height: iconH,
- decoration: BoxDecoration(
- border: border != null ? Border.all(color: AppColors.whiteColor, width: border) : null,
- borderRadius: borderRadius != null ? BorderRadius.circular(borderRadius ?? 12.r) : null,
- image: DecorationImage(
- image: AssetImage(
- icon,
- ),
- fit: fit)),
+ return PreserveImageColors(
+ child: Container(
+ width: iconW,
+ height: iconH,
+ decoration: BoxDecoration(
+ border: border != null ? Border.all(color: AppColors.whiteColor, width: border) : null,
+ borderRadius: BorderRadius.circular(borderRadius ?? 12.r),
+ image: DecorationImage(
+ image: AssetImage(
+ icon,
+ ),
+ fit: fit)),
+ ),
);
}
- /// Widget to build an SVG from network
+ /// Widget to build an image from network - automatically preserves colors in visual modes
static Widget buildImgWithNetwork({
required String url,
required Color iconColor,
@@ -873,16 +859,18 @@ class Utils {
}) {
final iconH = height ?? 24.h;
final iconW = width ?? 24.w;
- return Image.network(
- url,
- width: iconW,
- height: iconH,
- fit: fit,
- errorBuilder: errorBuilder ??
- (_, __, ___) {
- //todo_section change the error builder icon that it is returning
- return Utils.buildSvgWithAssets(width: iconW, height: iconH, icon: AppAssets.no_visit_icon);
- },
+ return PreserveImageColors(
+ child: Image.network(
+ url,
+ width: iconW,
+ height: iconH,
+ fit: fit,
+ errorBuilder: errorBuilder ??
+ (_, __, ___) {
+ //todo_section change the error builder icon that it is returning
+ return Utils.buildSvgWithAssets(width: iconW, height: iconH, icon: AppAssets.no_visit_icon);
+ },
+ ),
);
}
@@ -891,26 +879,37 @@ class Utils {
spacing: spacing.w,
mainAxisSize: MainAxisSize.max,
children: [
- Image.asset(AppAssets.mada, width: width.h, height: height.h),
- Image.asset(
- AppAssets.tamaraEng,
- width: width.h,
- height: height.h,
- fit: BoxFit.contain,
- errorBuilder: (context, error, stackTrace) {
- debugPrint('Failed to load Tamara PNG in payment methods: $error');
- return Utils.buildSvgWithAssets(icon: AppAssets.tamara, width: 35.h, height: 35.h, fit: BoxFit.contain);
- },
+ PreserveImageColors(
+ child: Image.asset(AppAssets.mada, width: width.h, height: height.h),
+ ),
+ PreserveImageColors(
+ child: Image.asset(
+ AppAssets.tamaraEng,
+ width: width.h,
+ height: height.h,
+ fit: BoxFit.contain,
+ errorBuilder: (context, error, stackTrace) {
+ debugPrint('Failed to load Tamara PNG in payment methods: $error');
+ return Utils.buildSvgWithAssets(icon: AppAssets.tamara, width: 35.h, height: 35.h, fit: BoxFit.contain);
+ },
+ ),
+ ),
+ PreserveImageColors(
+ child: Image.asset(AppAssets.visa, width: width.h, height: height.h),
),
- Image.asset(AppAssets.visa, width: width.h, height: height.h),
- Image.asset(AppAssets.mastercard, width: width.h, height: height.h),
- Platform.isIOS ? Image.asset(AppAssets.applePay, width: width.h, height: height.h) : SizedBox.shrink(),
+ PreserveImageColors(
+ child: Image.asset(AppAssets.mastercard, width: width.h, height: height.h),
+ ),
+ Platform.isIOS
+ ? PreserveImageColors(
+ child: Image.asset(AppAssets.applePay, width: width.h, height: height.h),
+ )
+ : SizedBox.shrink(),
],
);
}
- static Widget getPaymentAmountWithSymbol(Widget paymentAmountWidget, Color iconColor, double iconSize,
- {bool isSaudiCurrency = true, bool isExpanded = true}) {
+ static Widget getPaymentAmountWithSymbol(Widget paymentAmountWidget, Color iconColor, double iconSize, {bool isSaudiCurrency = true, bool isExpanded = true}) {
return Row(
mainAxisAlignment: isExpanded ? MainAxisAlignment.spaceBetween : MainAxisAlignment.start,
children: [
@@ -965,13 +964,7 @@ class Utils {
// text: NumberFormat.currency(locale: 'en_US', symbol: " ", decimalDigits: 0).format(habibWalletAmount),
// text: " ${(NumberFormat.decimalPattern().format(habibWalletAmount)).toStringAsFixed(2)}",
text: " ${(NumberFormat.decimalPattern().format(habibWalletAmount))}",
- style: TextStyle(
- color: resolvedTextColor,
- fontSize: fontSize ?? 32.f,
- letterSpacing: letterSpacing ?? -4,
- fontFamily: "Poppins",
- fontWeight: fontWeight ?? FontWeight.w600,
- height: 1),
+ style: TextStyle(color: resolvedTextColor, fontSize: fontSize ?? 32.f, letterSpacing: letterSpacing ?? -4, fontFamily: "Poppins", fontWeight: fontWeight ?? FontWeight.w600, height: 1),
),
],
),
@@ -1035,12 +1028,7 @@ class Utils {
static PatientDoctorAppointmentList? convertToPatientDoctorAppointmentList(HospitalsModel? hospital) {
if (hospital == null) return null;
return PatientDoctorAppointmentList(
- filterName: hospital.name,
- distanceInKMs: hospital.distanceInKilometers?.toString(),
- projectTopName: hospital.name,
- projectBottomName: hospital.name,
- model: hospital,
- isHMC: hospital.isHMC);
+ filterName: hospital.name, distanceInKMs: hospital.distanceInKilometers?.toString(), projectTopName: hospital.name, projectBottomName: hospital.name, model: hospital, isHMC: hospital.isHMC);
}
static HospitalsModel? convertToHospitalsModel(PatientDoctorAppointmentList? item) {
diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart
index 91fc3ef4..06d590cf 100644
--- a/lib/extensions/string_extensions.dart
+++ b/lib/extensions/string_extensions.dart
@@ -127,6 +127,7 @@ extension EmailValidator on String {
Widget toText12(
{bool isEnglishOnly = false,
Color? color,
+ Color? decorationColor,
bool isUnderLine = false,
TextAlign textAlignment = TextAlign.start,
bool isBold = false,
@@ -147,7 +148,7 @@ extension EmailValidator on String {
color: color ?? AppColors.blackColor,
letterSpacing: letterSpacing ?? 0,
height: height,
- decorationColor: isUnderLine ? AppColors.blackColor : null,
+ decorationColor: decorationColor ?? AppColors.blackColor,
decoration: isUnderLine ? TextDecoration.underline : null,
fontFamily: getIt.get().getLanguageCode() == "ar" ? 'CairoArabic' : 'Poppins',
),
diff --git a/lib/features/book_appointments/models/laser_body_parts_data.dart b/lib/features/book_appointments/models/laser_body_parts_data.dart
index 2f8b32dc..969aa1d0 100644
--- a/lib/features/book_appointments/models/laser_body_parts_data.dart
+++ b/lib/features/book_appointments/models/laser_body_parts_data.dart
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
-import 'package:flutter_svg/flutter_svg.dart';
+import 'package:hmg_patient_app_new/core/utils/utils.dart';
class LaserBodyParts {
static final LaserBodyParts _instance = LaserBodyParts._internal();
@@ -9,11 +9,11 @@ class LaserBodyParts {
factory LaserBodyParts() => _instance;
static Widget image(String assetUri) {
- return new SvgPicture.asset(assetUri, fit: BoxFit.cover, width: 88, height: 88);
+ return Utils.buildSvgWithAssets(icon: assetUri, fit: BoxFit.cover, width: 88, height: 88, applyThemeColor: false);
}
static Widget imagePng(String assetUri) {
- return Image.asset(assetUri, fit: BoxFit.cover, width: 88, height: 88);
+ return Utils.buildImgWithAssets(icon: assetUri, fit: BoxFit.cover, width: 88, height: 88);
}
Map maleBodyMap = {
diff --git a/lib/features/profile_settings/profile_settings_view_model.dart b/lib/features/profile_settings/profile_settings_view_model.dart
index 02cbc10f..c61665c3 100644
--- a/lib/features/profile_settings/profile_settings_view_model.dart
+++ b/lib/features/profile_settings/profile_settings_view_model.dart
@@ -13,9 +13,12 @@ import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
+import 'package:screen_brightness/screen_brightness.dart';
class ProfileSettingsViewModel extends ChangeNotifier {
static const String _darkModeKey = 'is_dark_mode';
+ static const String _fontSizeStepKey = 'accessibility_font_size_step';
+ static const String _visualModeKey = 'accessibility_visual_mode';
final CacheService _cacheService;
final ProfileSettingsRepo profileSettingsRepo;
@@ -25,6 +28,13 @@ class ProfileSettingsViewModel extends ChangeNotifier {
bool _isDarkMode = false;
bool get isDarkMode => _isDarkMode;
+ // ── Accessibility settings ───────────────────────────────────────────
+ int _fontSizeStep = 2; // 0: Small, 1: Small-Medium, 2: Medium (default), 3: Medium-Large, 4: Large
+ int get fontSizeStep => _fontSizeStep;
+
+ String _visualMode = 'off'; // off, invert, dim, highContrast
+ String get visualMode => _visualMode;
+
// ── Update email state ───────────────────────────────────────────────
bool isUpdateEmailLoading = false;
bool isUpdateEmailSuccess = false;
@@ -163,6 +173,68 @@ class ProfileSettingsViewModel extends ChangeNotifier {
notifyListeners();
}
+ // ── Accessibility settings ───────────────────────────────────────────
+
+ /// Load accessibility settings at app startup
+ void loadAccessibilitySettings() {
+ _fontSizeStep = _cacheService.getInt(key: _fontSizeStepKey) ?? 2;
+ _visualMode = _cacheService.getString(key: _visualModeKey) ?? 'off';
+
+ // Apply brightness based on saved visual mode
+ _applyBrightnessForMode(_visualMode);
+
+ // No notifyListeners() here — we are called before build.
+ }
+
+ /// Update font size step and save to cache
+ void setFontSizeStep(int step) {
+ _fontSizeStep = step;
+ _cacheService.saveInt(key: _fontSizeStepKey, value: step);
+ notifyListeners();
+ }
+
+ /// Update visual mode and save to cache
+ void setVisualMode(String mode) {
+ _visualMode = mode;
+ _cacheService.saveString(key: _visualModeKey, value: mode);
+ notifyListeners();
+ }
+
+ /// Apply screen brightness based on visual mode
+ void _applyBrightnessForMode(String mode) async {
+ try {
+ final screenBrightness = ScreenBrightness();
+
+ if (mode == 'dim') {
+ // Reduce brightness to 40% for dim mode
+ await screenBrightness.setScreenBrightness(0.4);
+ } else {
+ // For other modes, reset to system brightness
+ await screenBrightness.resetScreenBrightness();
+ }
+ } catch (e) {
+ print('Error applying brightness for mode: $e');
+ }
+ }
+
+ /// Get font scale multiplier based on current font size step
+ double getFontScaleMultiplier() {
+ switch (_fontSizeStep) {
+ case 0:
+ return 0.85; // Small
+ case 1:
+ return 0.95; // Small-Medium
+ case 2:
+ return 1.0; // Medium (default)
+ case 3:
+ return 1.15; // Medium-Large
+ case 4:
+ return 1.3; // Large
+ default:
+ return 1.0;
+ }
+ }
+
// ── Update patient info ──────────────────────────────────────────────
Future updatePatientInfo({
diff --git a/lib/features/symptoms_checker/models/resp_models/explanations_response_model.dart b/lib/features/symptoms_checker/models/resp_models/explanations_response_model.dart
new file mode 100644
index 00000000..88273d33
--- /dev/null
+++ b/lib/features/symptoms_checker/models/resp_models/explanations_response_model.dart
@@ -0,0 +1,147 @@
+class ExplanationsResponseModel {
+ final ExplanationsDataDetails? dataDetails;
+
+ ExplanationsResponseModel({this.dataDetails});
+
+ factory ExplanationsResponseModel.fromJson(Map json) {
+ return ExplanationsResponseModel(
+ dataDetails: json['dataDetails'] != null
+ ? ExplanationsDataDetails.fromJson(json['dataDetails'])
+ : null,
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'dataDetails': dataDetails?.toJson(),
+ };
+ }
+}
+
+class ExplanationsDataDetails {
+ final List? supportingEvidence;
+ final List? conflictingEvidence;
+ final List? unconfirmedEvidence;
+ final String? message;
+ final List? errorList;
+ final int? id;
+ final String? language;
+ final String? generalId;
+ final String? createDate;
+ final String? lastEditDate;
+ final String? createdBy;
+ final String? lastEditBy;
+ final bool? active;
+ final int? sortOrder;
+ final int? userType;
+ final String? userId;
+
+ ExplanationsDataDetails({
+ this.supportingEvidence,
+ this.conflictingEvidence,
+ this.unconfirmedEvidence,
+ this.message,
+ this.errorList,
+ this.id,
+ this.language,
+ this.generalId,
+ this.createDate,
+ this.lastEditDate,
+ this.createdBy,
+ this.lastEditBy,
+ this.active,
+ this.sortOrder,
+ this.userType,
+ this.userId,
+ });
+
+ factory ExplanationsDataDetails.fromJson(Map json) {
+ return ExplanationsDataDetails(
+ supportingEvidence: json['supporting_evidence'] != null
+ ? (json['supporting_evidence'] as List)
+ .map((item) => ExplanationEvidence.fromJson(item))
+ .toList()
+ : null,
+ conflictingEvidence: json['conflicting_evidence'] != null
+ ? (json['conflicting_evidence'] as List)
+ .map((item) => ExplanationEvidence.fromJson(item))
+ .toList()
+ : null,
+ unconfirmedEvidence: json['unconfirmed_evidence'] != null
+ ? (json['unconfirmed_evidence'] as List)
+ .map((item) => ExplanationEvidence.fromJson(item))
+ .toList()
+ : null,
+ message: json['Message'],
+ errorList: json['ErrorList'] != null
+ ? List.from(json['ErrorList'])
+ : null,
+ id: json['Id'],
+ language: json['language'],
+ generalId: json['generalId'],
+ createDate: json['CreateDate'],
+ lastEditDate: json['LastEditDate'],
+ createdBy: json['CreatedBy'],
+ lastEditBy: json['LastEditBy'],
+ active: json['Active'],
+ sortOrder: json['SortOrder'],
+ userType: json['userType'],
+ userId: json['userId'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'supporting_evidence': supportingEvidence?.map((item) => item.toJson()).toList(),
+ 'conflicting_evidence': conflictingEvidence?.map((item) => item.toJson()).toList(),
+ 'unconfirmed_evidence': unconfirmedEvidence?.map((item) => item.toJson()).toList(),
+ 'Message': message,
+ 'ErrorList': errorList,
+ 'Id': id,
+ 'language': language,
+ 'generalId': generalId,
+ 'CreateDate': createDate,
+ 'LastEditDate': lastEditDate,
+ 'CreatedBy': createdBy,
+ 'LastEditBy': lastEditBy,
+ 'Active': active,
+ 'SortOrder': sortOrder,
+ 'userType': userType,
+ 'userId': userId,
+ };
+ }
+}
+
+class ExplanationEvidence {
+ final String? id;
+ final String? name;
+ final String? commonName;
+
+ ExplanationEvidence({
+ this.id,
+ this.name,
+ this.commonName,
+ });
+
+ factory ExplanationEvidence.fromJson(Map json) {
+ return ExplanationEvidence(
+ id: json['id'],
+ name: json['name'],
+ commonName: json['common_name'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'id': id,
+ 'name': name,
+ 'common_name': commonName,
+ };
+ }
+
+ // Helper method to get display name
+ String getDisplayName() {
+ return commonName ?? name ?? '';
+ }
+}
+
diff --git a/lib/features/symptoms_checker/models/resp_models/rationale_response_model.dart b/lib/features/symptoms_checker/models/resp_models/rationale_response_model.dart
new file mode 100644
index 00000000..33d31172
--- /dev/null
+++ b/lib/features/symptoms_checker/models/resp_models/rationale_response_model.dart
@@ -0,0 +1,176 @@
+class RationaleResponseModel {
+ final RationaleDataDetails? dataDetails;
+
+ RationaleResponseModel({this.dataDetails});
+
+ factory RationaleResponseModel.fromJson(Map json) {
+ return RationaleResponseModel(
+ dataDetails: json['dataDetails'] != null
+ ? RationaleDataDetails.fromJson(json['dataDetails'])
+ : null,
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'dataDetails': dataDetails?.toJson(),
+ };
+ }
+}
+
+class RationaleDataDetails {
+ final String? type;
+ final List? observationParams;
+ final List? conditionParams;
+ final String? message;
+ final List? errorList;
+ final int? id;
+ final String? language;
+ final String? generalId;
+ final String? createDate;
+ final String? lastEditDate;
+ final String? createdBy;
+ final String? lastEditBy;
+ final bool? active;
+ final int? sortOrder;
+ final int? userType;
+ final String? userId;
+
+ RationaleDataDetails({
+ this.type,
+ this.observationParams,
+ this.conditionParams,
+ this.message,
+ this.errorList,
+ this.id,
+ this.language,
+ this.generalId,
+ this.createDate,
+ this.lastEditDate,
+ this.createdBy,
+ this.lastEditBy,
+ this.active,
+ this.sortOrder,
+ this.userType,
+ this.userId,
+ });
+
+ factory RationaleDataDetails.fromJson(Map json) {
+ return RationaleDataDetails(
+ type: json['type'],
+ observationParams: json['observation_params'] != null
+ ? (json['observation_params'] as List)
+ .map((item) => RationaleObservationParam.fromJson(item))
+ .toList()
+ : null,
+ conditionParams: json['condition_params'] != null
+ ? (json['condition_params'] as List)
+ .map((item) => RationaleConditionParam.fromJson(item))
+ .toList()
+ : null,
+ message: json['Message'],
+ errorList: json['ErrorList'] != null
+ ? List.from(json['ErrorList'])
+ : null,
+ id: json['Id'],
+ language: json['language'],
+ generalId: json['generalId'],
+ createDate: json['CreateDate'],
+ lastEditDate: json['LastEditDate'],
+ createdBy: json['CreatedBy'],
+ lastEditBy: json['LastEditBy'],
+ active: json['Active'],
+ sortOrder: json['SortOrder'],
+ userType: json['userType'],
+ userId: json['userId'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'type': type,
+ 'observation_params': observationParams?.map((item) => item.toJson()).toList(),
+ 'condition_params': conditionParams?.map((item) => item.toJson()).toList(),
+ 'Message': message,
+ 'ErrorList': errorList,
+ 'Id': id,
+ 'language': language,
+ 'generalId': generalId,
+ 'CreateDate': createDate,
+ 'LastEditDate': lastEditDate,
+ 'CreatedBy': createdBy,
+ 'LastEditBy': lastEditBy,
+ 'Active': active,
+ 'SortOrder': sortOrder,
+ 'userType': userType,
+ 'userId': userId,
+ };
+ }
+}
+
+class RationaleObservationParam {
+ final String? id;
+ final String? name;
+ final String? commonName;
+
+ RationaleObservationParam({
+ this.id,
+ this.name,
+ this.commonName,
+ });
+
+ factory RationaleObservationParam.fromJson(Map json) {
+ return RationaleObservationParam(
+ id: json['id'],
+ name: json['name'],
+ commonName: json['common_name'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'id': id,
+ 'name': name,
+ 'common_name': commonName,
+ };
+ }
+
+ // Helper method to get display name
+ String getDisplayName() {
+ return commonName ?? name ?? '';
+ }
+}
+
+class RationaleConditionParam {
+ final String? id;
+ final String? name;
+ final String? commonName;
+
+ RationaleConditionParam({
+ this.id,
+ this.name,
+ this.commonName,
+ });
+
+ factory RationaleConditionParam.fromJson(Map json) {
+ return RationaleConditionParam(
+ id: json['id'],
+ name: json['name'],
+ commonName: json['common_name'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'id': id,
+ 'name': name,
+ 'common_name': commonName,
+ };
+ }
+
+ // Helper method to get display name
+ String getDisplayName() {
+ return commonName ?? name ?? '';
+ }
+}
+
diff --git a/lib/features/symptoms_checker/models/resp_models/triage_level_response_model.dart b/lib/features/symptoms_checker/models/resp_models/triage_level_response_model.dart
new file mode 100644
index 00000000..7d8432bf
--- /dev/null
+++ b/lib/features/symptoms_checker/models/resp_models/triage_level_response_model.dart
@@ -0,0 +1,151 @@
+class TriageLevelResponseModel {
+ final TriageLevelDataDetails? dataDetails;
+
+ TriageLevelResponseModel({this.dataDetails});
+
+ factory TriageLevelResponseModel.fromJson(Map json) {
+ return TriageLevelResponseModel(
+ dataDetails: json['dataDetails'] != null
+ ? TriageLevelDataDetails.fromJson(json['dataDetails'])
+ : null,
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'dataDetails': dataDetails?.toJson(),
+ };
+ }
+}
+
+class TriageLevelDataDetails {
+ final String? triageLevel;
+ final List? serious;
+ final String? rootCause;
+ final bool? teleconsultationApplicable;
+ final String? message;
+ final List? errorList;
+ final int? id;
+ final String? language;
+ final String? generalId;
+ final String? createDate;
+ final String? lastEditDate;
+ final String? createdBy;
+ final String? lastEditBy;
+ final bool? active;
+ final int? sortOrder;
+ final int? userType;
+ final String? userId;
+
+ TriageLevelDataDetails({
+ this.triageLevel,
+ this.serious,
+ this.rootCause,
+ this.teleconsultationApplicable,
+ this.message,
+ this.errorList,
+ this.id,
+ this.language,
+ this.generalId,
+ this.createDate,
+ this.lastEditDate,
+ this.createdBy,
+ this.lastEditBy,
+ this.active,
+ this.sortOrder,
+ this.userType,
+ this.userId,
+ });
+
+ factory TriageLevelDataDetails.fromJson(Map json) {
+ return TriageLevelDataDetails(
+ triageLevel: json['triage_level'],
+ serious: json['serious'] != null
+ ? (json['serious'] as List)
+ .map((item) => SeriousEvidence.fromJson(item))
+ .toList()
+ : null,
+ rootCause: json['root_cause'],
+ teleconsultationApplicable: json['teleconsultation_applicable'],
+ message: json['Message'],
+ errorList: json['ErrorList'] != null
+ ? List.from(json['ErrorList'])
+ : null,
+ id: json['Id'],
+ language: json['language'],
+ generalId: json['generalId'],
+ createDate: json['CreateDate'],
+ lastEditDate: json['LastEditDate'],
+ createdBy: json['CreatedBy'],
+ lastEditBy: json['LastEditBy'],
+ active: json['Active'],
+ sortOrder: json['SortOrder'],
+ userType: json['userType'],
+ userId: json['userId'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'triage_level': triageLevel,
+ 'serious': serious?.map((item) => item.toJson()).toList(),
+ 'root_cause': rootCause,
+ 'teleconsultation_applicable': teleconsultationApplicable,
+ 'Message': message,
+ 'ErrorList': errorList,
+ 'Id': id,
+ 'language': language,
+ 'generalId': generalId,
+ 'CreateDate': createDate,
+ 'LastEditDate': lastEditDate,
+ 'CreatedBy': createdBy,
+ 'LastEditBy': lastEditBy,
+ 'Active': active,
+ 'SortOrder': sortOrder,
+ 'userType': userType,
+ 'userId': userId,
+ };
+ }
+}
+
+class SeriousEvidence {
+ final String? id;
+ final String? name;
+ final String? commonName;
+ final String? seriousness;
+ final bool? isEmergency;
+
+ SeriousEvidence({
+ this.id,
+ this.name,
+ this.commonName,
+ this.seriousness,
+ this.isEmergency,
+ });
+
+ factory SeriousEvidence.fromJson(Map json) {
+ return SeriousEvidence(
+ id: json['id'],
+ name: json['name'],
+ commonName: json['common_name'],
+ seriousness: json['seriousness'],
+ isEmergency: json['is_emergency'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'id': id,
+ 'name': name,
+ 'common_name': commonName,
+ 'seriousness': seriousness,
+ 'is_emergency': isEmergency,
+ };
+ }
+
+ // Helper method to get display name
+ String getDisplayName() {
+ return commonName ?? name ?? '';
+ }
+}
+
diff --git a/lib/features/symptoms_checker/models/resp_models/triage_response_model.dart b/lib/features/symptoms_checker/models/resp_models/triage_response_model.dart
index da0f4b67..e8992014 100644
--- a/lib/features/symptoms_checker/models/resp_models/triage_response_model.dart
+++ b/lib/features/symptoms_checker/models/resp_models/triage_response_model.dart
@@ -91,18 +91,28 @@ class TriageDataDetails {
class TriageQuestion {
final int? type;
final String? text;
+ final String? explication;
+ final List? instruction;
final List? items;
TriageQuestion({
this.type,
this.text,
+ this.explication,
+ this.instruction,
this.items,
});
factory TriageQuestion.fromJson(Map json) {
+ // TESTING: Add dummy instructions to every question for testing UI
+
return TriageQuestion(
type: json['type'],
text: json['text'],
+ explication: json['explication'],
+ // Use dummy if null
+ instruction: json['instruction'] != null ? List.from(json['instruction']) : [],
+ // Use dummy if null
items: json['items'] != null ? (json['items'] as List).map((item) => TriageQuestionItem.fromJson(item)).toList() : null,
);
}
@@ -111,9 +121,18 @@ class TriageQuestion {
return {
'type': type,
'text': text,
+ 'explication': explication,
+ 'instruction': instruction,
'items': items?.map((item) => item.toJson()).toList(),
};
}
+
+ /// Check if instruction OR explication is available
+ bool get hasInstructions {
+ final hasInstruction = instruction != null && instruction!.isNotEmpty;
+ final hasExplication = explication != null && explication!.isNotEmpty;
+ return hasInstruction || hasExplication;
+ }
}
class TriageQuestionItem {
diff --git a/lib/features/symptoms_checker/symptoms_checker_repo.dart b/lib/features/symptoms_checker/symptoms_checker_repo.dart
index 732b8553..77d3a2fa 100644
--- a/lib/features/symptoms_checker/symptoms_checker_repo.dart
+++ b/lib/features/symptoms_checker/symptoms_checker_repo.dart
@@ -8,10 +8,13 @@ import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/models/req_models/schedule_appointment_request_model.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/body_symptom_response_model.dart';
+import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/explanations_response_model.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/get_clinic_details_response_model.dart';
+import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/rationale_response_model.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/risk_and_suggestions_response_model.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/schedule_appointment_response_model.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/symptoms_user_details_response_model.dart';
+import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/triage_level_response_model.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models/triage_response_model.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
@@ -40,7 +43,7 @@ abstract class SymptomsCheckerRepo {
Future>> getSuggestions({
required int age,
required int gender,
- required List evidenceIds,
+ required List