diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 19db982..f49873a 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -1213,5 +1213,160 @@ "virtualTour": "جولة افتراضية", "carParking": "موقف السيارات", "latestNews": "آخر الأخبار", - "hmgContact": "اتصل بمجموعة الحبيب الطبية" + "hmgContact": "اتصل بمجموعة الحبيب الطبية", + "durationCannotExceed90": "لا يجوز أن تتجاوز المدة 90 دقيقة", + "unexpectedError": "حدث خطأ غير متوقع", + "gettingAmbulanceTransportOption": "جاري الحصول على خيارات نقل الإسعاف", + "fetchingAppointment": "جاري جلب الموعد", + "doYouWantToCancelTheRequest": "هل تريد إلغاء الطلب", + "cancellingRequest": "جاري إلغاء الطلب", + "fetchingTermsAndConditions": "جاري جلب الشروط والأحكام", + "selectLocationPrescriptionDelivery": "يرجى تحديد موقع توصيل الوصفة الطبية", + "noRadiologyOrders": "لم يتم العثور على أي طلبات تصوير شعاعي", + "ageIsRequired": "العمر مطلوب", + "invalidAge": "العمر غير صالح", + "ageMustBeBetween11And120": "يجب أن يكون العمر بين 11 و 120", + "heightIsRequired": "الطول مطلوب", + "invalidHeight": "الطول غير صالح", + "weightIsRequired": "الوزن مطلوب", + "invalidWeight": "الوزن غير صالح", + "timeToDrinkWater": "حان وقت شرب الماء! 💧", + "stayHydratedDrinkWater": "ابق رطبًا! اشرب {amount} مل من الماء.", + "visitPharmacyOnline": "زيارة الصيدلة على الانترنت", + "howAreYouFeelingToday": "كيف حالك اليوم؟", + "checkYourSymptomsWithScale": "تحقق من أعراضك باستخدام ذا المقياس", + "checkYourSymptoms": "تحقق من أعراضك", + "noUpcomingAppointmentPleaseBook": "ليس لديك أي مواعيد قادمة. يرجى حجز موعد", + "youHaveEROnlineCheckInRequest": "لديك طلب تسجيل وصول عبر الإنترنت للطوارئ", + "quickLinks": "روابط سريعة", + "viewMedicalFileLandingPage": "عرض الملف الطبي", + "immediateLiveCareRequest": "طلب LiveCare الفوري", + "yourTurnIsAfterPatients": "دورك بعد {count} مريض.", + "dontHaveHHCOrders": "ليس لديك أي أوامر رعاية صحية منزلية حتى الآن.", + "hhcOrders": "أوامر الرعاية الصحية المنزلية", + "requestedServices": "الخدمات المطلوبة", + "selectServices": "اختر الخدمات", + "selectedServices": "الخدمات المختارة", + "createNewRequest": "إنشاء طلب جديد", + "youHaveNoPendingRequests": "ليس لديك أي طلبات معلقة.", + "noInsuranceDataFound": "لم يتم العثور على بيانات التأمين...", + "noInsuranceUpdateRequest": "لم يتم العثور على أي طلبات لتحديث بيانات التأمين.", + "policyNumberInsurancePage": "الوثيقة: {number}", + "insuranceExpired": "التأمين منتهي الصلاحية", + "insuranceActive": "التأمين نشط", + "patientCardID": "رقم بطاقة المريض: {id}", + "noInsuranceApprovals": "لم تحصل على أي موافقات تأمينية حتى الآن.", + "noInsuranceWithHMG": "ليس لديك تأمين مسجل لدى مجموعة حبيب الطبية.", + "referenceRange": "النطاق المرجعي", + "downloadReport": "تنزيل التقرير", + "generatingReport": "جارٍ إنشاء التقرير، يرجى الانتظار...", + "noLabResults": "ليس لديك أي نتائج مختبرية حتى الآن.", + "labResultDetails": "تفاصيل نتائج المختبر", + "resultOf": "نتيجة", + "whatIsThisResult": "ما هي هذه النتيجة؟", + "lastTested": "آخر اختبار", + "byVisit": "حسب الزيارة", + "byTest": "حسب التحليل", + "results": "نتائج", + "viewResults": "عرض النتائج", + "rebook": "إعادة الحجز", + "noOphthalmologyAppointments": "لم يتم العثور على أي مواعيد في قسم طب العيون...", + "noVitalSignsRecordedYet": "لا توجد علامات حيوية مسجلة بعد", + "appointmentsAndVisits": "المواعيد والزيارات", + "labAndRadiology": "المختبر والأشعة", + "activeMedicationsAndPrescriptions": "الأدوية النشطة والوصفات الطبية", + "allPrescriptions": "جميع الوصفات", + "allMedications": "جميع الأدوية", + "youDontHaveAnyPrescriptionsYet": "ليس لديك أي وصفات طبية بعد.", + "youDontHaveAnyCompletedVisitsYet": "ليس لديك أي زيارات مكتملة بعد", + "others": "أخرى", + "allergyInfo": "معلومات الحساسية", + "vaccineInfo": "معلومات اللقاحات", + "updateInsuranceInfo": "تحديث التأمين", + "myInvoicesList": "قائمة فواتيري", + "ancillaryOrdersList": "قائمة الطلبات المساعدة", + "youDontHaveAnySickLeavesYet": "ليس لديك أي إجازات مرضية بعد.", + "medicalReports": "التقارير الطبية", + "sickLeaveReport": "تقرير الإجازة المرضية", + "weightTracker": "متتبع الوزن", + "askYourDoctor": "اسأل طبيبك", + "internetPairing": "الاقتران بالإنترنت", + "requested": "مطلوب", + "youDontHaveAnyMedicalReportsYet": "ليس لديك أي تقارير طبية بعد.", + "requestMedicalReport": "طلب تقرير طبي", + "youDoNotHaveAnyAppointmentsToRequestMedicalReport": "ليس لديك أي مواعيد لطلب تقرير طبي.", + "areYouSureYouWantToRequestMedicalReport": "هل أنت متأكد أنك تريد طلب تقرير طبي لهذا الموعد؟", + "yourMedicalReportRequestSubmittedSuccessfully": "تم إرسال طلب التقرير الطبي بنجاح.", + "monthlyHealthSummaryReportDisclaimer": "يعكس تقرير الملخص الصحي الشهري هذا المؤشرات الصحية ونتائج التحليل لأحدث الزيارات. يرجى ملاحظة أن هذا سيتم إرساله تلقائيًا من النظام ولا يعتبر تقريرًا رسميًا لذا لا ينبغي اتخاذ أي قرار طبي بناءً عليه", + "updatingMonthlyReportStatus": "جاري تحديث حالة التقرير الشهري...", + "monthlyReportStatusUpdatedSuccessfully": "تم تحديث حالة التقرير الشهري بنجاح", + "whoCanViewMyMedicalFile": "من يمكنه عرض ملفي الطبي؟", + "acceptedYourRequestToBeYourFamilyMember": "{status} طلبك لتكون فردًا من عائلتك", + "canViewYourFile": "يمكنه عرض ملفك", + "hasARequestPendingToBeYourFamilyMember": "لديه طلب {status} ليكون فردًا من عائلتك", + "wantsToAddYouAsTheirFamilyMember": "يريد إضافتك كفرد من عائلته", + "rejectedYourRequestToBeYourFamilyMember": "{status} طلبك لتكون فردًا من عائلتك", + "rejectedYourFamilyMemberRequest": "{status} طلب فرد عائلتك", + "notAvailable": "غير متاح", + "selectAProfile": "الرجاء تحديد ملف تعريف", + "switchFamilyFile": "قم بالتبديل من قائمة الملفات الطبية أدناه", + "medicalFiles": "الملفات الطبية", + "addANewFamilyMember": "إضافة فرد جديد من العائلة", + "viewInvoiceDetails": "عرض تفاصيل الفاتورة", + "outPatient": "مريض خارجي", + "invoiceDetails": "تفاصيل الفاتورة", + "sendingEmailPleaseWait": "جاري إرسال ال��ريد الإلكتروني، يرجى الانتظار...", + "emailSentSuccessfullyMessage": "تم إرسال البريد الإلكتروني بنجاح.", + "discount": "خصم", + "paid": "مدفوع", + "fetchingInvoiceDetails": "جارٍ جلب تفاصيل الفاتورة، يرجى الانتظار...", + "scanQRCode": "مسح رمز الاستجابة السريعة", + "parkingSlotDetails": "تفاصيل موقف السيارة", + "slotNumber": "رقم الموقف: {code}", + "basement": "الطابق: {description}", + "parkingDate": "التاريخ: {date}", + "parkedSince": "متوقف منذ: {time}", + "resetDirection": "إعادة تعيين الاتجاه", + "noPrescriptionOrdersYet": "ليس لديك أي طلبات وصفات طبية حتى الآن.", + "fetchingPrescriptionPDFPleaseWait": "جاري جلب ملف الوصفة الطبية، يرجى الانتظار...", + "ratingValue": "التقييم: {rating}", + "downloadPrescription": "تحميل الوصفة الطبية", + "fetchingPrescriptionDetails": "جاري جلب تفاصيل الوصفة الطبية...", + "switchBackFamilyFile": "العودة إلى ملف العائلة", + "profileAndSettings": "الملف الشخصي والإعدادات", + "quickActions": "إجراءات سريعة", + "notificationsSettings": "إعدادات الإشعارات", + "touchIDFaceIDServices": "خدمات Touch ID / Face ID", + "personalInformation": "المعلومات الشخصية", + "updateEmailAddress": "تحديث عنوان البريد الإلكتروني", + "helpAndSupport": "المساعدة والدعم", + "permissionsProfile": "الأذونات", + "privacyPolicy": "سياسة الخصوصية", + "deactivateAccount": "إلغاء تنشيط الحساب", + "ageYearsOld": "{age} {yearsOld}", + "youDontHaveRadiologyOrders": "ليس لديك أي نتائج للأشعة حتى الآن.", + "radiologyResult": "نتيجة الأشعة", + "viewRadiologyImage": "عرض صورة الأشعة", + "rateClinic": "تقييم العيادة", + "back": "رجوع", + "rateDoctor": "تقييم الطبيب", + "howWasYourLastVisitWithDoctor": "كيف كانت زيارتك الأخيرة مع الطبيب؟", + "dateOfBirthSymptoms": "ما هو تاريخ ميلادك؟", + "genderSymptoms": "ما هو جنسك؟", + "heightSymptoms": "كم طولك؟", + "weightSymptoms": "ما هو وزنك؟", + "femaleGender": "أنثى", + "previous": "سابق", + "selectedOrgans": "الهيئات المختارة", + "noOrgansSelected": "لم يتم تحديد أي أعضاء بعد", + "organSelector": "محدد الأعضاء", + "noPredictionsAvailable": "لا توجد تنبؤات متاحة", + "areYouSureYouWantToRestartOrganSelection": "هل أنت متأكد أنك تريد إعادة تشغيل اختيار الأعضاء؟", + "possibleConditions": "الحالات المحتملة", + "pleaseSelectAtLeastOneRiskBeforeProceeding": "يرجى اختيار عامل خطر واحد على الأقل قبل المتابعة", + "aboveYouSeeCommonRiskFactors": "أعلاه ترى عوامل الخطر الأكثر شيوعًا. على الرغم من أن /diagnosis قد تعيد أسئلة حول عوامل الخطر، ", + "readMore": "اقرأ المزيد", + "riskFactors": "عوامل الخطر", + "noRiskFactorsFound": "لم يتم العثور على عوامل خطر", + "basedOnYourSelectedSymptomsNoRiskFactors": "بناءً على الأعراض المحددة، لم يتم تحديد عوامل خطر إضافية." } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index ee489f5..c4b6c19 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -889,7 +889,6 @@ "pickADate": "Pick a Date", "confirmingAppointmentPleaseWait": "Confirming Appointment, Please Wait...", "appointmentConfirmedSuccessfully": "Appointment Confirmed Successfully", - "appointmentPayment": "Appointment Payment", "checkingPaymentStatusPleaseWait": "Checking payment status, Please wait...", "paymentFailedPleaseTryAgain": "Payment Failed! Please try again.", @@ -1207,5 +1206,160 @@ "virtualTour": "Virtual Tour", "carParking": "Car Parking", "latestNews": "Latest News", - "hmgContact": "HMG Contact" -} \ No newline at end of file + "hmgContact": "HMG Contact", + "durationCannotExceed90": "Duration can not exceed 90 mins", + "unexpectedError": "Unexpected Error Occurred", + "gettingAmbulanceTransportOption": "Getting Ambulance Transport Option", + "fetchingAppointment": "Fetching Appointment", + "doYouWantToCancelTheRequest": "Do you want to cancel the request", + "cancellingRequest": "Cancelling request", + "fetchingTermsAndConditions": "Fetching Terms And Conditions", + "selectLocationPrescriptionDelivery": "Please select the location for prescription delivery", + "noRadiologyOrders": "No Radiology Orders Found", + "ageIsRequired": "Age is required", + "invalidAge": "Invalid age", + "ageMustBeBetween11And120": "Age must be between 11 and 120", + "heightIsRequired": "Height is required", + "invalidHeight": "Invalid height", + "weightIsRequired": "Weight is required", + "invalidWeight": "Invalid weight", + "timeToDrinkWater": "Time to Drink Water! 💧", + "stayHydratedDrinkWater": "Stay hydrated! Drink {amount}ml of water.", + "visitPharmacyOnline": "Visit Pharmacy Online", + "howAreYouFeelingToday": "How are you feeling today?", + "checkYourSymptomsWithScale": "Check your symptoms with this scale", + "checkYourSymptoms": "Check your symptoms", + "noUpcomingAppointmentPleaseBook": "You do not have any upcoming appointment. Please book an appointment", + "youHaveEROnlineCheckInRequest": "You have ER Online Check-In Request", + "quickLinks": "Quick Links", + "viewMedicalFileLandingPage": "View medical file", + "immediateLiveCareRequest": "Immediate LiveCare Request", + "yourTurnIsAfterPatients": "Your turn is after {count} patients.", + "dontHaveHHCOrders": "You don't have any Home Health Care orders yet.", + "hhcOrders": "HHC Orders", + "requestedServices": "Requested Services", + "selectServices": "Select Services", + "selectedServices": "Selected Services", + "createNewRequest": "Create new request", + "youHaveNoPendingRequests": "You have no pending requests.", + "noInsuranceDataFound": "No insurance data found...", + "noInsuranceUpdateRequest": "No insurance update requests found.", + "policyNumberInsurancePage": "Policy: {number}", + "insuranceExpired": "Insurance Expired", + "insuranceActive": "Insurance Active", + "patientCardID": "Patient Card ID: {id}", + "noInsuranceApprovals": "You don't have any insurance approvals yet.", + "noInsuranceWithHMG": "You don't have insurance registered with HMG.", + "referenceRange": "Reference Range", + "downloadReport": "Download report", + "generatingReport": "Generating report, Please wait...", + "noLabResults": "You don't have any lab results yet.", + "labResultDetails": "Lab Result Details", + "resultOf": "Result of", + "whatIsThisResult": "What is this result?", + "lastTested": "Last Tested", + "byVisit": "By Visit", + "byTest": "By Test", + "results": "results", + "viewResults": "View Results", + "rebook": "Rebook", + "noOphthalmologyAppointments": "No Ophthalmology appointments found...", + "noVitalSignsRecordedYet": "No vital signs recorded yet", + "appointmentsAndVisits": "Appointments & visits", + "labAndRadiology": "Lab & Radiology", + "activeMedicationsAndPrescriptions": "Active Medications & Prescriptions", + "allPrescriptions": "All Prescriptions", + "allMedications": "All Medications", + "youDontHaveAnyPrescriptionsYet": "You don't have any prescriptions yet.", + "youDontHaveAnyCompletedVisitsYet": "You don't have any completed visits yet", + "others": "Others", + "allergyInfo": "Allergy Info", + "vaccineInfo": "Vaccine Info", + "updateInsuranceInfo": "Update Insurance", + "myInvoicesList": "My Invoices List", + "ancillaryOrdersList": "Ancillary Orders List", + "youDontHaveAnySickLeavesYet": "You don't have any sick leaves yet.", + "medicalReports": "Medical Reports", + "sickLeaveReport": "Sick Leave Report", + "weightTracker": "Weight Tracker", + "askYourDoctor": "Ask Your Doctor", + "internetPairing": "Internet Pairing", + "requested": "Requested", + "youDontHaveAnyMedicalReportsYet": "You don't have any medical reports yet.", + "requestMedicalReport": "Request medical report", + "youDoNotHaveAnyAppointmentsToRequestMedicalReport": "You do not have any appointments to request a medical report.", + "areYouSureYouWantToRequestMedicalReport": "Are you sure you want to request a medical report for this appointment?", + "yourMedicalReportRequestSubmittedSuccessfully": "Your medical report request has been successfully submitted.", + "monthlyHealthSummaryReportDisclaimer": "This monthly health summary report reflects the health indicators and analysis results of the latest visits. Please note that this will be sent automatically from the system and it's not considered as a official report so no medical decision should be taken based on it", + "updatingMonthlyReportStatus": "Updating Monthly Report Status...", + "monthlyReportStatusUpdatedSuccessfully": "Monthly Report Status Updated Successfully", + "whoCanViewMyMedicalFile": "Who can view my medical file?", + "acceptedYourRequestToBeYourFamilyMember": "{status} your request to be your family member", + "canViewYourFile": "can view your file", + "hasARequestPendingToBeYourFamilyMember": "has a request {status} to be your family member", + "wantsToAddYouAsTheirFamilyMember": "wants to add you as their family member", + "rejectedYourRequestToBeYourFamilyMember": "{status} your request to be your family member", + "rejectedYourFamilyMemberRequest": "{status} your family member request", + "notAvailable": "N/A", + "selectAProfile": "Please select a profile", + "switchFamilyFile": "Switch from the below list of medical file", + "medicalFiles": "Medical Files", + "addANewFamilyMember": "Add a new family member", + "viewInvoiceDetails": "View invoice details", + "outPatient": "OutPatient", + "invoiceDetails": "Invoice Details", + "sendingEmailPleaseWait": "Sending email, Please wait...", + "emailSentSuccessfullyMessage": "Email sent successfully.", + "discount": "Discount", + "paid": "Paid", + "fetchingInvoiceDetails": "Fetching invoice details, Please wait...", + "scanQRCode": "Scan QR code", + "parkingSlotDetails": "Parking Slot Details", + "slotNumber": "Slot: {code}", + "basement": "Basement: {description}", + "parkingDate": "Date: {date}", + "parkedSince": "Parked Since: {time}", + "resetDirection": "Reset Direction", + "noPrescriptionOrdersYet": "You don't have any prescription orders yet.", + "fetchingPrescriptionPDFPleaseWait": "Fetching prescription PDF, Please wait...", + "ratingValue": "Rating: {rating}", + "downloadPrescription": "Download Prescription", + "fetchingPrescriptionDetails": "Fetching prescription details...", + "switchBackFamilyFile": "Switch Back To Family File", + "profileAndSettings": "Profile & Settings", + "quickActions": "Quick Actions", + "notificationsSettings": "Notifications Settings", + "touchIDFaceIDServices": "Touch ID / Face ID Services", + "personalInformation": "Personal Information", + "updateEmailAddress": "Update Email Address", + "helpAndSupport": "Help & Support", + "permissionsProfile": "Permissions", + "privacyPolicy": "Privacy Policy", + "deactivateAccount": "Deactivate account", + "ageYearsOld": "{age} {yearsOld}", + "youDontHaveRadiologyOrders": "You don't have any radiology results yet.", + "radiologyResult": "Radiology Result", + "viewRadiologyImage": "View Radiology Image", + "rateClinic": "Rate Clinic", + "back": "Back", + "rateDoctor": "Rate Doctor", + "howWasYourLastVisitWithDoctor": "How was your last visit with doctor?", + "dateOfBirthSymptoms": "What is your Date of Birth?", + "genderSymptoms": "What is your gender?", + "heightSymptoms": "How tall are you?", + "weightSymptoms": "What is your weight?", + "femaleGender": "Female", + "previous": "Previous", + "selectedOrgans": "Selected Organs", + "noOrgansSelected": "No organs selected yet", + "organSelector": "Organ Selector", + "noPredictionsAvailable": "No Predictions available", + "areYouSureYouWantToRestartOrganSelection": "Are you sure you want to restart the organ selection?", + "possibleConditions": "Possible Conditions", + "pleaseSelectAtLeastOneRiskBeforeProceeding": "Please select at least one risk before proceeding", + "aboveYouSeeCommonRiskFactors": "Above you see the most common risk factors. Although /diagnosis may return questions about risk factors, ", + "readMore": "Read more", + "riskFactors": "Risk Factors", + "noRiskFactorsFound": "No risk factors found", + "basedOnYourSelectedSymptomsNoRiskFactors": "Based on your selected symptoms, no additional risk factors were identified." +} diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 720fda7..efefee1 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -680,7 +680,7 @@ const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard'; class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT diff --git a/lib/core/dependencies.dart b/lib/core/dependencies.dart index 45cd2a4..44a8bde 100644 --- a/lib/core/dependencies.dart +++ b/lib/core/dependencies.dart @@ -61,7 +61,6 @@ import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_repo.da import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart'; import 'package:hmg_patient_app_new/presentation/health_trackers/health_trackers_view_model.dart'; import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart'; -import 'package:hmg_patient_app_new/presentation/monthly_reports/monthly_reports_page.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; @@ -299,13 +298,13 @@ class AppDependencies { activePrescriptionsRepo: getIt() ), ); - // getIt.registerFactory( - // () => QrParkingViewModel( - // qrParkingRepo: getIt(), - // errorHandlerService: getIt(), - // cacheService: getIt(), - // ), - // ); + getIt.registerFactory( + () => QrParkingViewModel( + qrParkingRepo: getIt(), + errorHandlerService: getIt(), + cacheService: getIt(), + ), + ); } } diff --git a/lib/core/location_util.dart b/lib/core/location_util.dart index 9dcdbb5..cf26d24 100644 --- a/lib/core/location_util.dart +++ b/lib/core/location_util.dart @@ -104,7 +104,7 @@ class LocationUtils { title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), navigationService.navigatorKey.currentContext!, child: Utils.getWarningWidget( - loadingText: "Please grant location permission from app settings to see better results".needTranslation, + loadingText: "Please grant location permission from app settings to see better results", isShowActionButtons: true, onCancelTap: () { navigationService.pop(); @@ -265,7 +265,7 @@ class LocationUtils { title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), navigationService.navigatorKey.currentContext!, child: Utils.getWarningWidget( - loadingText: "Please grant location permission from app settings to see better results".needTranslation, + loadingText: "Please grant location permission from app settings to see better results", isShowActionButtons: true, onCancelTap: () { navigationService.pop(); diff --git a/lib/core/utils/calendar_utils.dart b/lib/core/utils/calendar_utils.dart index 8c0db18..8b21111 100644 --- a/lib/core/utils/calendar_utils.dart +++ b/lib/core/utils/calendar_utils.dart @@ -215,14 +215,14 @@ showReminderBottomSheet(BuildContext context, DateTime dateTime, String doctorNa Future _showReminderBottomSheet(BuildContext providedContext, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, {required Function onSuccess, String? title, String? description, Function(int)? onMultiDateSuccess, bool? isMultiAllowed}) async { - showCommonBottomSheetWithoutHeight(providedContext, title: "Set the timer of reminder".needTranslation, child: PrescriptionReminderView( + showCommonBottomSheetWithoutHeight(providedContext, title: "Set the timer of reminder", child: PrescriptionReminderView( setReminder: (int value) async { if (!isMultiAllowed!) { if (onMultiDateSuccess == null) { CalendarUtils calendarUtils = await CalendarUtils.getInstance(); await calendarUtils.createOrUpdateEvent( - title: title ?? "You have appointment with Dr. ".needTranslation + doctorName, - description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted, + title: title ?? "You have appointment with Dr. $doctorName", + description: description ?? "At $appoDateFormatted $appoTimeFormatted", scheduleDateTime: dateTime, eventId: eventId, location: ''); diff --git a/lib/features/blood_donation/widgets/hospital_selection.dart b/lib/features/blood_donation/widgets/hospital_selection.dart index 288ac34..c6065ae 100644 --- a/lib/features/blood_donation/widgets/hospital_selection.dart +++ b/lib/features/blood_donation/widgets/hospital_selection.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; @@ -8,6 +9,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/blood_donation/blood_donation_view_model.dart'; import 'package:hmg_patient_app_new/features/blood_donation/models/blood_group_hospitals_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart' show AppColors; import 'package:provider/provider.dart'; @@ -23,14 +25,7 @@ class HospitalBottomSheetBodySelection extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "Please select the hospital you want to make an appointment.".needTranslation, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: AppColors.greyTextColor, - ), - ), + LocaleKeys.selectHospital.tr(context: context).toText16(weight: FontWeight.w500, color: AppColors.greyTextColor), SizedBox(height: 16.h), SizedBox( height: MediaQuery.sizeOf(context).height * .4, diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 3f5517a..664f244 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -473,7 +473,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { result.fold( (failure) async { - onError!("No doctors found for the search criteria".needTranslation); + onError!(LocaleKeys.noDoctorFound.tr()); }, (apiResponse) { if (apiResponse.messageStatus == 2) { @@ -501,7 +501,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { result.fold( (failure) async { isDoctorsListLoading = false; - if (onError != null) onError("No doctors found for the search criteria".needTranslation); + if (onError != null) onError(LocaleKeys.noDoctorFound.tr()); notifyListeners(); }, @@ -533,7 +533,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { result.fold( (failure) async { isDoctorsListLoading = false; - if (onError != null) onError("No doctors found for the search criteria".needTranslation); + if (onError != null) onError(LocaleKeys.noDoctorFound.tr()); notifyListeners(); }, @@ -569,7 +569,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { result.fold( (failure) async { - onError?.call("No doctors found for the search criteria".needTranslation); + onError?.call(LocaleKeys.noDoctorFound.tr()); }, (apiResponse) async { if (apiResponse.messageStatus == 2) { @@ -784,7 +784,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { ); showCommonBottomSheet(navigationService.navigatorKey.currentContext!, - child: Utils.getLoadingWidget(loadingText: "Cancelling your previous appointment....".needTranslation), + child: Utils.getLoadingWidget(loadingText: LocaleKeys.cancellingAppointmentPleaseWait.tr()), callBackFunc: (str) {}, title: "", height: ResponsiveExtension.screenHeight * 0.3, @@ -794,7 +794,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async { navigationService.pop(); Future.delayed(Duration(milliseconds: 50)).then((value) async {}); - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: "Booking your appointment...".needTranslation); + LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr()); await insertSpecificAppointment( onError: (err) {}, onSuccess: (apiResp) async { @@ -880,7 +880,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { ); showCommonBottomSheet(navigationService.navigatorKey.currentContext!, - child: Utils.getLoadingWidget(loadingText: "Cancelling your previous appointment....".needTranslation), + child: Utils.getLoadingWidget(loadingText: LocaleKeys.cancellingAppointmentPleaseWait.tr()), callBackFunc: (str) {}, title: "", height: ResponsiveExtension.screenHeight * 0.3, @@ -890,7 +890,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async { navigationService.pop(); Future.delayed(Duration(milliseconds: 50)).then((value) async {}); - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: "Booking your appointment...".needTranslation); + LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr()); await insertSpecificAppointment( onError: (err) {}, onSuccess: (apiResp) async { @@ -1204,7 +1204,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { result.fold( (failure) async { - onError!("No doctors found for the search criteria...".needTranslation); + onError!(LocaleKeys.noDoctorFound.tr()); }, (apiResponse) { if (apiResponse.messageStatus == 2) { @@ -1291,18 +1291,18 @@ class BookAppointmentsViewModel extends ChangeNotifier { notifyListeners(); } else { - if (this.duration == 90) { - dialogService.showErrorBottomSheet( - message: "Duration can not exceed 90 min".needTranslation, - ); - return; - } + // if (this.duration == 90) { + // dialogService.showErrorBottomSheet( + // message: "Duration can not exceed 90 min".needTranslation, + // ); + // return; + // } selectedBodyPartList.add(part); var duration = getDuration(); if (duration > 90) { selectedBodyPartList.remove(part); dialogService.showErrorBottomSheet( - message: "Duration Exceeds 90 min".needTranslation, + message: LocaleKeys.durationCannotExceed90.tr(), ); return; } @@ -1336,7 +1336,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { result.fold( (failure) async { - onError!("Invalid verification point scanned.".needTranslation); + onError!("Invalid verification point scanned."); }, (apiResponse) { // if (apiResponse.data['returnValue'] == 0) { @@ -1410,7 +1410,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { ); } else if (apiResponse.messageStatus == 1) { if (apiResponse.data == null || apiResponse.data!.isEmpty) { - onError!("Unexpected Error Occurred".needTranslation); + onError!(LocaleKeys.unexpectedError.tr()); return; } notifyListeners(); diff --git a/lib/features/emergency_services/emergency_services_view_model.dart b/lib/features/emergency_services/emergency_services_view_model.dart index 400eb04..ec21179 100644 --- a/lib/features/emergency_services/emergency_services_view_model.dart +++ b/lib/features/emergency_services/emergency_services_view_model.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart' as GMSMapServices; import 'package:hmg_patient_app_new/core/app_assets.dart'; @@ -32,6 +33,7 @@ import 'package:hmg_patient_app_new/features/my_appointments/models/facility_sel import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/RRT/rrt_request_type_select.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/RRT/terms_and_condition.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/call_ambulance_page.dart'; @@ -152,7 +154,7 @@ class EmergencyServicesViewModel extends ChangeNotifier { print("the app state is ${appState.isAuthenticated}"); if (!appState.isAuthenticated) { dialogService.showErrorBottomSheet( - message: "You Need To Login First To Continue".needTranslation, + message: LocaleKeys.loginToUseService.tr(), onOkPressed: () { navServices.pop(); getIt().onLoginPressed(); @@ -196,7 +198,6 @@ class EmergencyServicesViewModel extends ChangeNotifier { } void filterErList(String query) { - print("the query is $query"); if (query.isEmpty) { nearestERFilteredList = nearestERList; } else { @@ -277,7 +278,6 @@ class EmergencyServicesViewModel extends ChangeNotifier { flushData(); selectedFacility = FacilitySelection.ALL; - print("the app state is ${appState.isAuthenticated}"); if (appState.isAuthenticated) { locationUtils!.getLocation( isShowConfirmDialog: true, @@ -289,7 +289,7 @@ class EmergencyServicesViewModel extends ChangeNotifier { }); } else { dialogService.showErrorBottomSheet( - message: "You Need To Login First To Continue".needTranslation, + message: LocaleKeys.loginToUseService.tr(), onOkPressed: () { navServices.pop(); navServices.pushAndReplace(AppRoutes.loginScreen); @@ -311,7 +311,7 @@ class EmergencyServicesViewModel extends ChangeNotifier { void updateBottomSheetState(BottomSheetType sheetType) { if (sheetType == BottomSheetType.EXPANDED && selectedHospital == null) { - dialogService.showErrorBottomSheet(message: "Kindly Select Hospital".needTranslation); + dialogService.showErrorBottomSheet(message: LocaleKeys.selectHospital.tr()); return; } bottomSheetType = sheetType; @@ -481,21 +481,18 @@ class EmergencyServicesViewModel extends ChangeNotifier { Future getTransportationOption() async { //handle the cache if the data is present then dont fetch it in the authenticated lifecycle - - print("the app state is ${appState.isAuthenticated}"); if (appState.isAuthenticated == false) { dialogService.showErrorBottomSheet( - message: "You Need To Login First To Continue".needTranslation, + message: LocaleKeys.loginToUseService.tr(), onOkPressed: () { navServices.pop(); - print("inside the ok button"); getIt().onLoginPressed(); }); return; } int? id = appState.getAuthenticatedUser()?.patientId; - LoaderBottomSheet.showLoader(loadingText: "Getting Ambulance Transport Option".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.gettingAmbulanceTransportOption.tr()); notifyListeners(); var response = await emergencyServicesRepo.getTransportationMethods(id: id); @@ -514,7 +511,7 @@ class EmergencyServicesViewModel extends ChangeNotifier { Future getTransportationMethods() async { int? id = appState.getAuthenticatedUser()?.patientId; - LoaderBottomSheet.showLoader(loadingText: "Getting Ambulance Transport Option".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.gettingAmbulanceTransportOption.tr()); notifyListeners(); var response = await emergencyServicesRepo.getTransportationMethods(id: id); @@ -703,7 +700,7 @@ class EmergencyServicesViewModel extends ChangeNotifier { } Future getAppointments() async { - LoaderBottomSheet.showLoader(loadingText: "Fetching Appointment".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingAppointment.tr()); var result = await appointmentRepo.getPatientAppointments(isActiveAppointment: true, isArrivedAppointments: false); LoaderBottomSheet.hideLoader(); @@ -860,10 +857,10 @@ class EmergencyServicesViewModel extends ChangeNotifier { Future cancelOrder(AmbulanceRequestOrdersModel? order, {bool shouldPop = false}) async { dialogService.showCommonBottomSheetWithoutH( - message: "Do you want to cancel the request".needTranslation, + message: LocaleKeys.doYouWantToCancelTheRequest.tr(), onOkPressed: () async { navServices.pop(); - LoaderBottomSheet.showLoader(loadingText: "Cancelling request".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.cancellingRequest.tr()); var response = await emergencyServicesRepo.cancelOrder(order?.iD, appState.getAuthenticatedUser()?.patientId ?? 0); LoaderBottomSheet.hideLoader(); response.fold((failure) => errorHandlerService.handleError(failure: failure), (success) { @@ -968,10 +965,10 @@ class EmergencyServicesViewModel extends ChangeNotifier { FutureOr cancelRRTOrder(int? orderID, {bool shouldPop = false}) async { dialogService.showCommonBottomSheetWithoutH( - message: "Do you want to cancel the request".needTranslation, + message: LocaleKeys.doYouWantToCancelTheRequest.tr(), onOkPressed: () async { navServices.pop(); - LoaderBottomSheet.showLoader(loadingText: "Cancelling request".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.cancellingRequest.tr()); var response = await emergencyServicesRepo.cancelRRTOrder(orderID); LoaderBottomSheet.hideLoader(); response.fold((failure) => errorHandlerService.handleError(failure: failure), (success) { @@ -1001,11 +998,10 @@ class EmergencyServicesViewModel extends ChangeNotifier { } void openRRT() { - print("the app state is ${appState.isAuthenticated}"); if (appState.isAuthenticated) { if (agreedToTermsAndCondition == false) { dialogService.showErrorBottomSheet( - message: "You Need To Agree To Terms And Conditions".needTranslation, + message: LocaleKeys.pleaseAcceptTermsConditions.tr(), onOkPressed: () { if (navServices.context == null) return; showCommonBottomSheetWithoutHeight( @@ -1042,9 +1038,9 @@ class EmergencyServicesViewModel extends ChangeNotifier { bool result = await navServices.push( CustomPageRoute( page: MapUtilityScreen( - confirmButtonString: "Submit Request".needTranslation, - titleString: "Select Location".needTranslation, - subTitleString: "Please select the location".needTranslation, + confirmButtonString: LocaleKeys.submitRequest.tr(), + titleString: LocaleKeys.selectLocation.tr(), + subTitleString: LocaleKeys.pleaseSelectTheLocation.tr(), isGmsAvailable: appState.isGMSAvailable, ), direction: AxisDirection.down), @@ -1059,7 +1055,7 @@ class EmergencyServicesViewModel extends ChangeNotifier { }); } else { dialogService.showErrorBottomSheet( - message: "You Need To Login First To Continue".needTranslation, + message: LocaleKeys.loginToUseService.tr(), onOkPressed: () { navServices.pop(); getIt().onLoginPressed(); @@ -1072,12 +1068,11 @@ class EmergencyServicesViewModel extends ChangeNotifier { } FutureOr getTermsAndConditions() async { - LoaderBottomSheet.showLoader(loadingText: "Fetching Terms And Conditions".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingTermsAndConditions.tr()); var response = await emergencyServicesRepo.getTermsAndCondition(); LoaderBottomSheet.hideLoader(); response.fold((failure) => errorHandlerService.handleError(failure: failure), (success) { termsAndConditions = success.data; - print("the response terms are $termsAndConditions"); notifyListeners(); navServices.push( CustomPageRoute(page: TermsAndCondition(termsAndCondition: success.data ?? ""), direction: AxisDirection.down), diff --git a/lib/features/my_appointments/utils/appointment_type.dart b/lib/features/my_appointments/utils/appointment_type.dart index abc23dc..aa2ef38 100644 --- a/lib/features/my_appointments/utils/appointment_type.dart +++ b/lib/features/my_appointments/utils/appointment_type.dart @@ -84,7 +84,7 @@ class AppointmentType { static String getNextActionText(nextAction) { switch (nextAction) { case 0: - return "No Action".needTranslation; + return LocaleKeys.upcomingNoAction.tr(); case 10: return LocaleKeys.confirm.tr(); case 15: @@ -96,7 +96,7 @@ class AppointmentType { case 90: return LocaleKeys.checkinOption.tr(); default: - return "No Action".needTranslation; + return LocaleKeys.upcomingNoAction.tr(); } } diff --git a/lib/features/prescriptions/prescriptions_view_model.dart b/lib/features/prescriptions/prescriptions_view_model.dart index ff86406..3f9af34 100644 --- a/lib/features/prescriptions/prescriptions_view_model.dart +++ b/lib/features/prescriptions/prescriptions_view_model.dart @@ -245,8 +245,8 @@ class PrescriptionsViewModel extends ChangeNotifier { CustomPageRoute( page: MapUtilityScreen( confirmButtonString: LocaleKeys.next.tr(), - titleString: "Select Location".needTranslation, - subTitleString: "Please select the location for prescription delivery".needTranslation, + titleString: LocaleKeys.selectLocation.tr(), + subTitleString: LocaleKeys.selectLocationPrescriptionDelivery.tr(), isGmsAvailable: getIt.get().isGMSAvailable, ), direction: AxisDirection.down), diff --git a/lib/features/radiology/radiology_view_model.dart b/lib/features/radiology/radiology_view_model.dart index 986945e..46a27bf 100644 --- a/lib/features/radiology/radiology_view_model.dart +++ b/lib/features/radiology/radiology_view_model.dart @@ -1,7 +1,9 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/features/authentication/models/resp_models/authenticated_user_resp_model.dart'; import 'package:hmg_patient_app_new/features/radiology/radiology_repo.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/radiology/radiology_result_page.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; @@ -97,7 +99,7 @@ class RadiologyViewModel extends ChangeNotifier { ); } else { if (onError != null) { - onError("No Radiology Orders Found".needTranslation); + onError(LocaleKeys.noRadiologyOrders.tr()); } } } diff --git a/lib/features/water_monitor/water_monitor_view_model.dart b/lib/features/water_monitor/water_monitor_view_model.dart index d82712a..1ef2ef6 100644 --- a/lib/features/water_monitor/water_monitor_view_model.dart +++ b/lib/features/water_monitor/water_monitor_view_model.dart @@ -1,5 +1,6 @@ import 'dart:developer'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; @@ -14,6 +15,7 @@ import 'package:hmg_patient_app_new/features/water_monitor/models/update_user_de import 'package:hmg_patient_app_new/features/water_monitor/models/user_progress_models.dart'; import 'package:hmg_patient_app_new/features/water_monitor/models/water_cup_model.dart'; import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_repo.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/routes/app_routes.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; @@ -598,36 +600,36 @@ class WaterMonitorViewModel extends ChangeNotifier { String? validateAge() { if (ageController.text.trim().isEmpty) { - return 'Age is required'.needTranslation; + return LocaleKeys.ageIsRequired.tr(); } final age = int.tryParse(ageController.text.trim()); if (age == null) { - return 'Invalid age'.needTranslation; + return LocaleKeys.invalidAge.tr(); } if (age < 11 || age > 120) { - return 'Age must be between 11 and 120'.needTranslation; + return LocaleKeys.ageMustBeBetween11And120.tr(); } return null; } String? validateHeight() { if (heightController.text.trim().isEmpty) { - return 'Height is required'.needTranslation; + return LocaleKeys.heightIsRequired.tr(); } final height = double.tryParse(heightController.text.trim()); if (height == null || height <= 0) { - return 'Invalid height'.needTranslation; + return LocaleKeys.invalidHeight.tr(); } return null; } String? validateWeight() { if (weightController.text.trim().isEmpty) { - return 'Weight is required'.needTranslation; + return LocaleKeys.weightIsRequired.tr(); } final weight = double.tryParse(weightController.text.trim()); if (weight == null || weight <= 0) { - return 'Invalid weight'.needTranslation; + return LocaleKeys.invalidWeight.tr(); } return null; } @@ -1212,8 +1214,8 @@ class WaterMonitorViewModel extends ChangeNotifier { // Schedule water reminders await notificationService.scheduleWaterReminders( reminderTimes: reminderTimes, - title: 'Time to Drink Water! 💧'.needTranslation, - body: 'Stay hydrated! Drink ${selectedCupCapacityMl}ml of water.'.needTranslation, + title: LocaleKeys.timeToDrinkWater.tr(), + body: LocaleKeys.stayHydratedDrinkWater.tr(namedArgs: {'amount': selectedCupCapacityMl.toString()}), ); // Save reminder enabled state to cache @@ -1334,8 +1336,8 @@ class WaterMonitorViewModel extends ChangeNotifier { await notificationService.scheduleNotification( id: 9999, // Use a unique ID for test notifications - title: 'Time to Drink Water! 💧'.needTranslation, - body: 'Stay hydrated! Drink ${selectedCupCapacityMl}ml of water.'.needTranslation, + title: LocaleKeys.timeToDrinkWater.tr(), + body: LocaleKeys.stayHydratedDrinkWater.tr(namedArgs: {'amount': selectedCupCapacityMl.toString()}), scheduledDate: scheduledTime, payload: 'test_notification', ); diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 689587c..a3989ad 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1208,5 +1208,160 @@ abstract class LocaleKeys { static const carParking = 'carParking'; static const latestNews = 'latestNews'; static const hmgContact = 'hmgContact'; + static const durationCannotExceed90 = 'durationCannotExceed90'; + static const unexpectedError = 'unexpectedError'; + static const gettingAmbulanceTransportOption = 'gettingAmbulanceTransportOption'; + static const fetchingAppointment = 'fetchingAppointment'; + static const doYouWantToCancelTheRequest = 'doYouWantToCancelTheRequest'; + static const cancellingRequest = 'cancellingRequest'; + static const fetchingTermsAndConditions = 'fetchingTermsAndConditions'; + static const selectLocationPrescriptionDelivery = 'selectLocationPrescriptionDelivery'; + static const noRadiologyOrders = 'noRadiologyOrders'; + static const ageIsRequired = 'ageIsRequired'; + static const invalidAge = 'invalidAge'; + static const ageMustBeBetween11And120 = 'ageMustBeBetween11And120'; + static const heightIsRequired = 'heightIsRequired'; + static const invalidHeight = 'invalidHeight'; + static const weightIsRequired = 'weightIsRequired'; + static const invalidWeight = 'invalidWeight'; + static const timeToDrinkWater = 'timeToDrinkWater'; + static const stayHydratedDrinkWater = 'stayHydratedDrinkWater'; + static const visitPharmacyOnline = 'visitPharmacyOnline'; + static const howAreYouFeelingToday = 'howAreYouFeelingToday'; + static const checkYourSymptomsWithScale = 'checkYourSymptomsWithScale'; + static const checkYourSymptoms = 'checkYourSymptoms'; + static const noUpcomingAppointmentPleaseBook = 'noUpcomingAppointmentPleaseBook'; + static const youHaveEROnlineCheckInRequest = 'youHaveEROnlineCheckInRequest'; + static const quickLinks = 'quickLinks'; + static const viewMedicalFileLandingPage = 'viewMedicalFileLandingPage'; + static const immediateLiveCareRequest = 'immediateLiveCareRequest'; + static const yourTurnIsAfterPatients = 'yourTurnIsAfterPatients'; + static const dontHaveHHCOrders = 'dontHaveHHCOrders'; + static const hhcOrders = 'hhcOrders'; + static const requestedServices = 'requestedServices'; + static const selectServices = 'selectServices'; + static const selectedServices = 'selectedServices'; + static const createNewRequest = 'createNewRequest'; + static const youHaveNoPendingRequests = 'youHaveNoPendingRequests'; + static const noInsuranceDataFound = 'noInsuranceDataFound'; + static const noInsuranceUpdateRequest = 'noInsuranceUpdateRequest'; + static const policyNumberInsurancePage = 'policyNumberInsurancePage'; + static const insuranceExpired = 'insuranceExpired'; + static const insuranceActive = 'insuranceActive'; + static const patientCardID = 'patientCardID'; + static const noInsuranceApprovals = 'noInsuranceApprovals'; + static const noInsuranceWithHMG = 'noInsuranceWithHMG'; + static const referenceRange = 'referenceRange'; + static const downloadReport = 'downloadReport'; + static const generatingReport = 'generatingReport'; + static const noLabResults = 'noLabResults'; + static const labResultDetails = 'labResultDetails'; + static const resultOf = 'resultOf'; + static const whatIsThisResult = 'whatIsThisResult'; + static const lastTested = 'lastTested'; + static const byVisit = 'byVisit'; + static const byTest = 'byTest'; + static const results = 'results'; + static const viewResults = 'viewResults'; + static const rebook = 'rebook'; + static const noOphthalmologyAppointments = 'noOphthalmologyAppointments'; + static const noVitalSignsRecordedYet = 'noVitalSignsRecordedYet'; + static const appointmentsAndVisits = 'appointmentsAndVisits'; + static const labAndRadiology = 'labAndRadiology'; + static const activeMedicationsAndPrescriptions = 'activeMedicationsAndPrescriptions'; + static const allPrescriptions = 'allPrescriptions'; + static const allMedications = 'allMedications'; + static const youDontHaveAnyPrescriptionsYet = 'youDontHaveAnyPrescriptionsYet'; + static const youDontHaveAnyCompletedVisitsYet = 'youDontHaveAnyCompletedVisitsYet'; + static const others = 'others'; + static const allergyInfo = 'allergyInfo'; + static const vaccineInfo = 'vaccineInfo'; + static const updateInsuranceInfo = 'updateInsuranceInfo'; + static const myInvoicesList = 'myInvoicesList'; + static const ancillaryOrdersList = 'ancillaryOrdersList'; + static const youDontHaveAnySickLeavesYet = 'youDontHaveAnySickLeavesYet'; + static const medicalReports = 'medicalReports'; + static const sickLeaveReport = 'sickLeaveReport'; + static const weightTracker = 'weightTracker'; + static const askYourDoctor = 'askYourDoctor'; + static const internetPairing = 'internetPairing'; + static const requested = 'requested'; + static const youDontHaveAnyMedicalReportsYet = 'youDontHaveAnyMedicalReportsYet'; + static const requestMedicalReport = 'requestMedicalReport'; + static const youDoNotHaveAnyAppointmentsToRequestMedicalReport = 'youDoNotHaveAnyAppointmentsToRequestMedicalReport'; + static const areYouSureYouWantToRequestMedicalReport = 'areYouSureYouWantToRequestMedicalReport'; + static const yourMedicalReportRequestSubmittedSuccessfully = 'yourMedicalReportRequestSubmittedSuccessfully'; + static const monthlyHealthSummaryReportDisclaimer = 'monthlyHealthSummaryReportDisclaimer'; + static const updatingMonthlyReportStatus = 'updatingMonthlyReportStatus'; + static const monthlyReportStatusUpdatedSuccessfully = 'monthlyReportStatusUpdatedSuccessfully'; + static const whoCanViewMyMedicalFile = 'whoCanViewMyMedicalFile'; + static const acceptedYourRequestToBeYourFamilyMember = 'acceptedYourRequestToBeYourFamilyMember'; + static const canViewYourFile = 'canViewYourFile'; + static const hasARequestPendingToBeYourFamilyMember = 'hasARequestPendingToBeYourFamilyMember'; + static const wantsToAddYouAsTheirFamilyMember = 'wantsToAddYouAsTheirFamilyMember'; + static const rejectedYourRequestToBeYourFamilyMember = 'rejectedYourRequestToBeYourFamilyMember'; + static const rejectedYourFamilyMemberRequest = 'rejectedYourFamilyMemberRequest'; + static const notAvailable = 'notAvailable'; + static const selectAProfile = 'selectAProfile'; + static const switchFamilyFile = 'switchFamilyFile'; + static const medicalFiles = 'medicalFiles'; + static const addANewFamilyMember = 'addANewFamilyMember'; + static const viewInvoiceDetails = 'viewInvoiceDetails'; + static const outPatient = 'outPatient'; + static const invoiceDetails = 'invoiceDetails'; + static const sendingEmailPleaseWait = 'sendingEmailPleaseWait'; + static const emailSentSuccessfullyMessage = 'emailSentSuccessfullyMessage'; + static const discount = 'discount'; + static const paid = 'paid'; + static const fetchingInvoiceDetails = 'fetchingInvoiceDetails'; + static const scanQRCode = 'scanQRCode'; + static const parkingSlotDetails = 'parkingSlotDetails'; + static const slotNumber = 'slotNumber'; + static const basement = 'basement'; + static const parkingDate = 'parkingDate'; + static const parkedSince = 'parkedSince'; + static const resetDirection = 'resetDirection'; + static const noPrescriptionOrdersYet = 'noPrescriptionOrdersYet'; + static const fetchingPrescriptionPDFPleaseWait = 'fetchingPrescriptionPDFPleaseWait'; + static const ratingValue = 'ratingValue'; + static const downloadPrescription = 'downloadPrescription'; + static const fetchingPrescriptionDetails = 'fetchingPrescriptionDetails'; + static const switchBackFamilyFile = 'switchBackFamilyFile'; + static const profileAndSettings = 'profileAndSettings'; + static const quickActions = 'quickActions'; + static const notificationsSettings = 'notificationsSettings'; + static const touchIDFaceIDServices = 'touchIDFaceIDServices'; + static const personalInformation = 'personalInformation'; + static const updateEmailAddress = 'updateEmailAddress'; + static const helpAndSupport = 'helpAndSupport'; + static const permissionsProfile = 'permissionsProfile'; + static const privacyPolicy = 'privacyPolicy'; + static const deactivateAccount = 'deactivateAccount'; + static const ageYearsOld = 'ageYearsOld'; + static const youDontHaveRadiologyOrders = 'youDontHaveRadiologyOrders'; + static const radiologyResult = 'radiologyResult'; + static const viewRadiologyImage = 'viewRadiologyImage'; + static const rateClinic = 'rateClinic'; + static const back = 'back'; + static const rateDoctor = 'rateDoctor'; + static const howWasYourLastVisitWithDoctor = 'howWasYourLastVisitWithDoctor'; + static const dateOfBirthSymptoms = 'dateOfBirthSymptoms'; + static const genderSymptoms = 'genderSymptoms'; + static const heightSymptoms = 'heightSymptoms'; + static const weightSymptoms = 'weightSymptoms'; + static const femaleGender = 'femaleGender'; + static const previous = 'previous'; + static const selectedOrgans = 'selectedOrgans'; + static const noOrgansSelected = 'noOrgansSelected'; + static const organSelector = 'organSelector'; + static const noPredictionsAvailable = 'noPredictionsAvailable'; + static const areYouSureYouWantToRestartOrganSelection = 'areYouSureYouWantToRestartOrganSelection'; + static const possibleConditions = 'possibleConditions'; + static const pleaseSelectAtLeastOneRiskBeforeProceeding = 'pleaseSelectAtLeastOneRiskBeforeProceeding'; + static const aboveYouSeeCommonRiskFactors = 'aboveYouSeeCommonRiskFactors'; + static const readMore = 'readMore'; + static const riskFactors = 'riskFactors'; + static const noRiskFactorsFound = 'noRiskFactorsFound'; + static const basedOnYourSelectedSymptomsNoRiskFactors = 'basedOnYourSelectedSymptomsNoRiskFactors'; } diff --git a/lib/main.dart b/lib/main.dart index 5158706..ec3b7ec 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -32,6 +32,7 @@ import 'package:hmg_patient_app_new/features/notifications/notifications_view_mo import 'package:hmg_patient_app_new/features/payfort/payfort_view_model.dart'; import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_model.dart'; import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart'; +import 'package:hmg_patient_app_new/features/qr_parking/qr_parking_view_model.dart'; import 'package:hmg_patient_app_new/features/radiology/radiology_view_model.dart'; import 'package:hmg_patient_app_new/features/smartwatch_health_data/health_provider.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; @@ -191,6 +192,9 @@ void main() async { ChangeNotifierProvider( create: (_) => getIt.get(), ), + ChangeNotifierProvider( + create: (_) => getIt.get(), + ), ChangeNotifierProvider( create: (_) => getIt.get(), ) diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index f336c5b..fc400c4 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -275,11 +275,11 @@ class _LandingPageState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "How are you feeling today?".needTranslation.toText14(isBold: true), - "Check your symptoms with this scale".needTranslation.toText12(fontWeight: FontWeight.w500), + LocaleKeys.howAreYouFeelingToday.tr(context: context).toText14(isBold: true), + LocaleKeys.checkYourSymptomsWithScale.tr(context: context).toText12(fontWeight: FontWeight.w500), SizedBox(height: 14.h), CustomButton( - text: "Check your symptoms".needTranslation, + text: LocaleKeys.checkYourSymptoms.tr(context: context), onPressed: () async { context.navigateWithName(AppRoutes.userInfoSelection); }, @@ -416,7 +416,7 @@ class _LandingPageState extends State { children: [ Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h), SizedBox(height: 12.h), - "You do not have any upcoming appointment. Please book an appointment".needTranslation.toText12(isCenter: true), + LocaleKeys.noUpcomingAppointmentPleaseBook.tr(context: context).toText12(isCenter: true), SizedBox(height: 12.h), CustomButton( text: LocaleKeys.bookAppo.tr(context: context), @@ -476,7 +476,7 @@ class _LandingPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "You have ER Online Check-In Request".needTranslation.toText12(isBold: true), + LocaleKeys.youHaveEROnlineCheckInRequest.tr(context: context).toText12(isBold: true), Utils.buildSvgWithAssets( icon: AppAssets.forward_arrow_icon_small, iconColor: AppColors.blackColor, @@ -503,10 +503,10 @@ class _LandingPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Quick Links".needTranslation.toText16(isBold: true), + LocaleKeys.quickLinks.tr(context: context).toText16(isBold: true), Row( children: [ - "View medical file".needTranslation.toText12(color: AppColors.primaryRedColor), + LocaleKeys.viewMedicalFile.tr(context: context).toText12(color: AppColors.primaryRedColor), SizedBox(width: 2.h), Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h), ], @@ -664,7 +664,7 @@ class _LandingPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppCustomChipWidget( - labelText: myAppointmentsViewModel.currentQueueStatus == 0 ? "In Queue".needTranslation : "Your Turn".needTranslation, + labelText: myAppointmentsViewModel.currentQueueStatus == 0 ? LocaleKeys.inQueue.tr() : LocaleKeys.yourTurn.tr(), backgroundColor: Utils.getCardBorderColor(myAppointmentsViewModel.currentQueueStatus).withValues(alpha: 0.20), textColor: Utils.getCardBorderColor(myAppointmentsViewModel.currentQueueStatus), ), @@ -672,9 +672,9 @@ class _LandingPageState extends State { ], ), SizedBox(height: 8.h), - "Hala ${appState.getAuthenticatedUser()!.firstName}!!!".needTranslation.toText16(isBold: true), + LocaleKeys.halaFirstName.tr(namedArgs: {'firstName': appState.getAuthenticatedUser()!.firstName!}).toText16(isBold: true), SizedBox(height: 2.h), - "Thank you for your patience, here is your queue number.".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), + LocaleKeys.thankYouForPatience.tr().toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), SizedBox(height: 8.h), myAppointmentsViewModel.currentPatientQueueDetails.queueNo!.toText28(isBold: true), SizedBox(height: 6.h), @@ -683,7 +683,7 @@ class _LandingPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - "Serving Now: ".needTranslation.toText14(isBold: true), + "${LocaleKeys.servingNow.tr()}: ".toText14(isBold: true), Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -691,7 +691,7 @@ class _LandingPageState extends State { SizedBox(width: 8.w), AppCustomChipWidget( deleteIcon: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1 ? AppAssets.call_for_vitals : AppAssets.call_for_doctor, - labelText: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1 ? "Call for vital signs".needTranslation : "Call for Doctor".needTranslation, + labelText: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1 ? LocaleKeys.callForVitalSigns.tr() : LocaleKeys.callForDoctor.tr(), iconColor: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1 ? AppColors.primaryRedColor : AppColors.successColor, textColor: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1 ? AppColors.primaryRedColor : AppColors.successColor, iconSize: 14.w, @@ -746,7 +746,7 @@ class _LandingPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Immediate LiveCare Request".needTranslation.toText16(isBold: true), + LocaleKeys.immediateLiveCareRequest.tr(context: context).toText16(isBold: true), SizedBox(height: 10.h), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -769,14 +769,14 @@ class _LandingPageState extends State { ], ), SizedBox(height: 10.h), - "Hala ${appState.getAuthenticatedUser()!.firstName}!!!".needTranslation.toText16(isBold: true), + LocaleKeys.halaFirstName.tr(namedArgs: {'firstName': appState.getAuthenticatedUser()!.firstName!}, context: context).toText16(isBold: true), SizedBox(height: 8.h), - "Your turn is after ${immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount} patients.".needTranslation.toText14(isBold: true), + LocaleKeys.yourTurnIsAfterPatients.tr(namedArgs: {'count': immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount.toString()}, context: context).toText14(isBold: true), SizedBox(height: 8.h), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Expected waiting time: ".needTranslation.toText12(isBold: true), + "${LocaleKeys.waitingTime.tr()}: ".toText12(isBold: true), SizedBox(height: 7.h), ValueListenableBuilder( valueListenable: immediateLiveCareViewModel.durationNotifier, diff --git a/lib/presentation/home/widgets/habib_wallet_card.dart b/lib/presentation/home/widgets/habib_wallet_card.dart index b2649f9..9058c8f 100644 --- a/lib/presentation/home/widgets/habib_wallet_card.dart +++ b/lib/presentation/home/widgets/habib_wallet_card.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; @@ -5,6 +6,7 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/habib_wallet/habib_wallet_page.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; @@ -115,7 +117,7 @@ class HabibWalletCard extends StatelessWidget { CustomButton( icon: AppAssets.recharge_icon, iconSize: 18.h, - text: "Recharge".needTranslation, + text: LocaleKeys.recharge.tr(context: context), onPressed: () {}, backgroundColor: AppColors.infoColor, borderColor: AppColors.infoColor, diff --git a/lib/presentation/home/widgets/large_service_card.dart b/lib/presentation/home/widgets/large_service_card.dart index 5274d5b..6025ba8 100644 --- a/lib/presentation/home/widgets/large_service_card.dart +++ b/lib/presentation/home/widgets/large_service_card.dart @@ -98,7 +98,7 @@ class LargeServiceCard extends StatelessWidget { ], ).paddingSymmetrical(16.w, 20.h), CustomButton( - text: serviceCardData.isBold ? "Visit Pharmacy Online".needTranslation : LocaleKeys.bookNow.tr(context: context), + text: serviceCardData.isBold ? LocaleKeys.visitPharmacyOnline.tr() : LocaleKeys.bookNow.tr(context: context), onPressed: () { handleOnTap(); }, diff --git a/lib/presentation/home/widgets/welcome_widget.dart b/lib/presentation/home/widgets/welcome_widget.dart index 8ef0697..1bb17b5 100644 --- a/lib/presentation/home/widgets/welcome_widget.dart +++ b/lib/presentation/home/widgets/welcome_widget.dart @@ -1,7 +1,9 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; class WelcomeWidget extends StatelessWidget { @@ -31,7 +33,7 @@ class WelcomeWidget extends StatelessWidget { spacing: 4.h, mainAxisSize: MainAxisSize.min, children: [ - "Welcome".needTranslation.toText14(color: AppColors.greyTextColor, height: 1, weight: FontWeight.w500), + LocaleKeys.welcome.tr(context: context).toText14(color: AppColors.greyTextColor, height: 1, weight: FontWeight.w500), Row( spacing: 4.h, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/presentation/home_health_care/hhc_order_detail_page.dart b/lib/presentation/home_health_care/hhc_order_detail_page.dart index 92c93d1..7017441 100644 --- a/lib/presentation/home_health_care/hhc_order_detail_page.dart +++ b/lib/presentation/home_health_care/hhc_order_detail_page.dart @@ -10,6 +10,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_all_orders_resp_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; @@ -121,7 +122,7 @@ class _HhcOrderDetailPageState extends State { Row( children: [ if (!isLoading) ...[ - "Request ID:".needTranslation.toText14( + LocaleKeys.requestID.tr(context: context).toText14( color: AppColors.textColorLight, weight: FontWeight.w500, ), @@ -186,7 +187,7 @@ class _HhcOrderDetailPageState extends State { ), child: Utils.getNoDataWidget( context, - noDataText: "You don't have any Home Health Care orders yet.".needTranslation, + noDataText: LocaleKeys.dontHaveHHCOrders.tr(context: context), isSmallWidget: true, width: 62.w, height: 62.h, @@ -199,7 +200,7 @@ class _HhcOrderDetailPageState extends State { @override Widget build(BuildContext context) { return CollapsingListView( - title: "HHC Orders".needTranslation, + title: LocaleKeys.hhcOrders.tr(context: context), isLeading: true, child: SingleChildScrollView( child: Column( diff --git a/lib/presentation/home_health_care/hhc_procedures_page.dart b/lib/presentation/home_health_care/hhc_procedures_page.dart index be97a88..ef5dce5 100644 --- a/lib/presentation/home_health_care/hhc_procedures_page.dart +++ b/lib/presentation/home_health_care/hhc_procedures_page.dart @@ -11,6 +11,7 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_all_orders_resp_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_services_resp_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_order_detail_page.dart'; import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_selection_review_page.dart'; import 'package:hmg_patient_app_new/presentation/home_health_care/widgets/hhc_ui_selection_helper.dart'; @@ -93,7 +94,7 @@ class _HhcProceduresPageState extends State { children: [ Row( children: [ - "Request ID:".needTranslation.toText14(color: AppColors.textColorLight, weight: FontWeight.w500), + LocaleKeys.requestID.tr(context: context).toText14(color: AppColors.textColorLight, weight: FontWeight.w500), SizedBox(width: 4.w), "${order.iD ?? '-'}".toText16(isBold: true), ], @@ -132,7 +133,7 @@ class _HhcProceduresPageState extends State { color: AppColors.primaryRedColor, ), SizedBox(width: 6.w), - "Requested Services".needTranslation.toText14( + LocaleKeys.requestedServices.tr().toText14( weight: FontWeight.w600, color: AppColors.blackColor, ), @@ -209,7 +210,7 @@ class _HhcProceduresPageState extends State { ), SizedBox(width: 8.w), Expanded( - child: "You have a pending order. Please wait for it to be processed.".needTranslation.toText12( + child: LocaleKeys.pendingOrderWait.tr(context: context).toText12( color: AppColors.infoBannerTextColor, fontWeight: FontWeight.w500, ), @@ -223,7 +224,7 @@ class _HhcProceduresPageState extends State { children: [ Expanded( child: CustomButton( - text: "Cancel Order".needTranslation, + text: LocaleKeys.cancelOrder.tr(context: context), onPressed: () => HhcUiSelectionHelper.showCancelConfirmationDialog(context: context, order: order), backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, @@ -248,7 +249,7 @@ class _HhcProceduresPageState extends State { hasBottomPadding: false, padding: EdgeInsets.only(top: 24.h), context, - title: 'Select Services'.needTranslation, + title: LocaleKeys.selectServices.tr(context: context), isCloseButtonVisible: true, isDismissible: true, callBackFunc: () {}, @@ -257,9 +258,9 @@ class _HhcProceduresPageState extends State { child: Padding( padding: EdgeInsets.all(24.h), child: Text( - 'No services available'.needTranslation, + LocaleKeys.noServicesAvailable.tr(context: context), style: TextStyle( - fontSize: 16.h, + fontSize: 16.f, color: AppColors.greyTextColor, ), ), @@ -300,7 +301,7 @@ class _HhcProceduresPageState extends State { duration: const Duration(milliseconds: 300), curve: Curves.easeInOut, width: 24.w, - height: 24.w, + height: 24.h, decoration: BoxDecoration( color: isSelected ? AppColors.primaryRedColor : Colors.transparent, borderRadius: BorderRadius.circular(5.r), @@ -353,7 +354,7 @@ class _HhcProceduresPageState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Selected Services".needTranslation.toText12( + LocaleKeys.selectedServices.tr(context: context).toText12( color: AppColors.textColorLight, fontWeight: FontWeight.w600, ), @@ -368,7 +369,7 @@ class _HhcProceduresPageState extends State { SizedBox(height: 16.h), CustomButton( borderWidth: 0, - text: "Next".needTranslation, + text: LocaleKeys.next.tr(context: context), onPressed: () { Navigator.pop(context); _proceedWithSelectedService(); @@ -398,9 +399,9 @@ class _HhcProceduresPageState extends State { bool result = await navigationServices.push( CustomPageRoute( page: MapUtilityScreen( - confirmButtonString: "Submit Request ".needTranslation, - titleString: "Select Location", - subTitleString: "Please select the location".needTranslation, + confirmButtonString: LocaleKeys.submitRequest.tr(context: context), + titleString: LocaleKeys.selectLocation.tr(context: context), + subTitleString: LocaleKeys.pleaseSelectTheLocation.tr(context: context), isGmsAvailable: appState.isGMSAvailable, ), direction: AxisDirection.down), @@ -447,7 +448,7 @@ class _HhcProceduresPageState extends State { return Scaffold( backgroundColor: AppColors.bgScaffoldColor, body: CollapsingListView( - title: "Home Health Care".needTranslation, + title: LocaleKeys.homeHealthCare.tr(context: context), history: () => Navigator.of(context).push(CustomPageRoute(page: HhcOrderDetailPage(), direction: AxisDirection.up)), bottomChild: Consumer( builder: (BuildContext context, HmgServicesViewModel hmgServicesViewModel, Widget? child) { @@ -466,7 +467,7 @@ class _HhcProceduresPageState extends State { padding: EdgeInsets.all(24.w), child: CustomButton( borderWidth: 0, - text: "Create new request".needTranslation, + text: LocaleKeys.createNewRequest.tr(context: context), onPressed: () => _buildServicesListBottomsSheet(hmgServicesViewModel.hhcServicesList), textColor: AppColors.whiteColor, borderRadius: 12.r, @@ -494,7 +495,7 @@ class _HhcProceduresPageState extends State { Center( child: Utils.getNoDataWidget( context, - noDataText: "You have no pending requests.".needTranslation, + noDataText: LocaleKeys.youHaveNoPendingRequests.tr(context: context), ), ), ], diff --git a/lib/presentation/home_health_care/hhc_selection_review_page.dart b/lib/presentation/home_health_care/hhc_selection_review_page.dart index 37410e2..ae2430a 100644 --- a/lib/presentation/home_health_care/hhc_selection_review_page.dart +++ b/lib/presentation/home_health_care/hhc_selection_review_page.dart @@ -50,7 +50,7 @@ class _HhcSelectionReviewPageState extends State { final isArabic = appState.isArabic(); return CollapsingListView( - title: "Summary".needTranslation, + title: LocaleKeys.summary.tr(context: context), bottomChild: _buildBottomButton(), child: SingleChildScrollView( padding: EdgeInsets.all(16.w), @@ -75,7 +75,7 @@ class _HhcSelectionReviewPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Selected Services".needTranslation.toText14( + LocaleKeys.selectedServices.tr(context: context).toText14( weight: FontWeight.w600, color: AppColors.textColor, letterSpacing: -0.4, @@ -86,7 +86,7 @@ class _HhcSelectionReviewPageState extends State { runSpacing: 12.w, children: widget.selectedServices.map((service) { final serviceName = isArabic ? (service.textN ?? service.text ?? '') : (service.text ?? ''); - return AppCustomChipWidget(labelText: serviceName.needTranslation); + return AppCustomChipWidget(labelText: serviceName); }).toList(), ), ], @@ -110,7 +110,7 @@ class _HhcSelectionReviewPageState extends State { if (lat == 0.0 || lng == 0.0) return SizedBox.shrink(); // Get address from geocode response - String address = "Selected Location".needTranslation; + String address = LocaleKeys.selectLocation.tr(context: context); if (geocodeResponse != null && geocodeResponse.results.isNotEmpty) { address = geocodeResponse.results.first.formattedAddress; } @@ -133,7 +133,7 @@ class _HhcSelectionReviewPageState extends State { ), child: CustomButton( borderWidth: 0, - text: "Confirm".needTranslation, + text: LocaleKeys.confirm.tr(context: context), onPressed: () => _handleConfirm(), textColor: AppColors.whiteColor, borderRadius: 12.r, @@ -155,10 +155,10 @@ class _HhcSelectionReviewPageState extends State { padding: EdgeInsets.all(16.w), child: Column( children: [ - Utils.getSuccessWidget(loadingText: "Your request has been successfully submitted.".needTranslation), + Utils.getSuccessWidget(loadingText: LocaleKeys.requestSubmittedSuccessfully.tr(context: context)), Row( children: [ - "Here is your request #: ".needTranslation.toText14( + LocaleKeys.hereIsYourRequestNumber.tr(context: context).toText14( color: AppColors.textColorLight, weight: FontWeight.w500, ), @@ -200,7 +200,7 @@ class _HhcSelectionReviewPageState extends State { title: LocaleKeys.notice.tr(context: context), context, child: Utils.getWarningWidget( - loadingText: "Are you sure you want to submit this request?".needTranslation, + loadingText: LocaleKeys.confirmSubmitRequest.tr(context: context), isShowActionButtons: true, onCancelTap: () { Navigator.pop(context); diff --git a/lib/presentation/home_health_care/widgets/hhc_ui_selection_helper.dart b/lib/presentation/home_health_care/widgets/hhc_ui_selection_helper.dart index 688612c..d5310b3 100644 --- a/lib/presentation/home_health_care/widgets/hhc_ui_selection_helper.dart +++ b/lib/presentation/home_health_care/widgets/hhc_ui_selection_helper.dart @@ -25,7 +25,7 @@ class HhcUiSelectionHelper { title: LocaleKeys.notice.tr(context: context), context, child: Utils.getWarningWidget( - loadingText: "Are you sure you want to cancel this order?".needTranslation, + loadingText: LocaleKeys.cancelOrderConfirmation.tr(context: context), isShowActionButtons: true, onCancelTap: () { Navigator.pop(context); @@ -51,7 +51,7 @@ class HhcUiSelectionHelper { padding: EdgeInsets.all(16.w), child: Column( children: [ - Utils.getSuccessWidget(loadingText: "Order has been cancelled successfully".needTranslation), + Utils.getSuccessWidget(loadingText: LocaleKeys.orderCancelledSuccessfully.tr(context: context)), SizedBox(height: 24.h), Row( children: [ diff --git a/lib/presentation/insurance/insurance_approval_details_page.dart b/lib/presentation/insurance/insurance_approval_details_page.dart index 415d66f..a6d8157 100644 --- a/lib/presentation/insurance/insurance_approval_details_page.dart +++ b/lib/presentation/insurance/insurance_approval_details_page.dart @@ -56,7 +56,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget { AppCustomChipWidget( icon: (!insuranceApprovalResponseModel.isLiveCareAppointment! ? AppAssets.walkin_appointment_icon : AppAssets.small_livecare_icon), iconColor: !insuranceApprovalResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor, - labelText: insuranceApprovalResponseModel.isLiveCareAppointment! ? LocaleKeys.livecare.tr(context: context) : "Walk In".needTranslation, + labelText: insuranceApprovalResponseModel.isLiveCareAppointment! ? LocaleKeys.livecare.tr(context: context) : LocaleKeys.walkin.tr(context: context), backgroundColor: (!insuranceApprovalResponseModel.isLiveCareAppointment! ? AppColors.greyColor : AppColors.successColor), textColor: (!insuranceApprovalResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor), ), @@ -137,7 +137,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Status:".needTranslation.toText14(isBold: true), + "${LocaleKeys.status.tr(context: context)}: ".toText14(isBold: true), insuranceApprovalResponseModel.apporvalDetails!.status!.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), ], ), diff --git a/lib/presentation/insurance/insurance_approvals_page.dart b/lib/presentation/insurance/insurance_approvals_page.dart index b70c116..52f8b1f 100644 --- a/lib/presentation/insurance/insurance_approvals_page.dart +++ b/lib/presentation/insurance/insurance_approvals_page.dart @@ -95,7 +95,7 @@ class _InsuranceApprovalsPageState extends State { ), ), ) - : Utils.getNoDataWidget(context, noDataText: "You don't have any insurance approvals yet.".needTranslation); + : Utils.getNoDataWidget(context, noDataText: LocaleKeys.noInsuranceApprovals.tr(context: context)); }, separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), ), diff --git a/lib/presentation/insurance/insurance_home_page.dart b/lib/presentation/insurance/insurance_home_page.dart index b005e42..04940fb 100644 --- a/lib/presentation/insurance/insurance_home_page.dart +++ b/lib/presentation/insurance/insurance_home_page.dart @@ -78,7 +78,7 @@ class _InsuranceHomePageState extends State { padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.12), child: Utils.getNoDataWidget( context, - noDataText: "You don't have insurance registered with HMG.".needTranslation, + noDataText: LocaleKeys.noInsuranceWithHMG.tr(context: context), callToActionButton: CustomButton( icon: AppAssets.update_insurance_card_icon, iconColor: AppColors.successColor, diff --git a/lib/presentation/insurance/widgets/insurance_approval_card.dart b/lib/presentation/insurance/widgets/insurance_approval_card.dart index ee31538..588f988 100644 --- a/lib/presentation/insurance/widgets/insurance_approval_card.dart +++ b/lib/presentation/insurance/widgets/insurance_approval_card.dart @@ -54,7 +54,7 @@ class InsuranceApprovalCard extends StatelessWidget { ? "Walk In" : insuranceApprovalResponseModel.isLiveCareAppointment! ? LocaleKeys.livecare.tr(context: context) - : "Walk In".needTranslation, + : LocaleKeys.walkin.tr(context: context), backgroundColor: isLoading ? AppColors.greyColor : (!insuranceApprovalResponseModel.isLiveCareAppointment! ? AppColors.greyColor : AppColors.successColor), textColor: isLoading ? AppColors.textColor : (!insuranceApprovalResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor), ).toShimmer2(isShow: isLoading), diff --git a/lib/presentation/insurance/widgets/insurance_history.dart b/lib/presentation/insurance/widgets/insurance_history.dart index 341e234..7219a34 100644 --- a/lib/presentation/insurance/widgets/insurance_history.dart +++ b/lib/presentation/insurance/widgets/insurance_history.dart @@ -111,7 +111,7 @@ class InsuranceHistory extends StatelessWidget { ) : Utils.getNoDataWidget( context, - noDataText: "No insurance update requests found.".needTranslation, + noDataText: LocaleKeys.noInsuranceUpdateRequest.tr(context: context), // isSmallWidget: true, // width: 62, // height: 62, diff --git a/lib/presentation/insurance/widgets/insurance_update_details_card.dart b/lib/presentation/insurance/widgets/insurance_update_details_card.dart index c3bbcd7..c737732 100644 --- a/lib/presentation/insurance/widgets/insurance_update_details_card.dart +++ b/lib/presentation/insurance/widgets/insurance_update_details_card.dart @@ -90,7 +90,7 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget { ], ).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(24.h, 0.h) - : Utils.getNoDataWidget(context, noDataText: "No insurance data found...".needTranslation), + : Utils.getNoDataWidget(context, noDataText: LocaleKeys.noInsuranceDataFound.tr(context: context)), SizedBox( height: 24.h, ), diff --git a/lib/presentation/insurance/widgets/patient_insurance_card.dart b/lib/presentation/insurance/widgets/patient_insurance_card.dart index fde5811..84fdee4 100644 --- a/lib/presentation/insurance/widgets/patient_insurance_card.dart +++ b/lib/presentation/insurance/widgets/patient_insurance_card.dart @@ -50,12 +50,12 @@ class PatientInsuranceCard extends StatelessWidget { children: [ SizedBox( width: MediaQuery.of(context).size.width * 0.45, child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true)), - "Policy: ${insuranceCardDetailsModel.insurancePolicyNo}".needTranslation.toText12(isBold: true, color: AppColors.lightGrayColor), + LocaleKeys.policyNumber.tr(namedArgs: {'number': insuranceCardDetailsModel.insurancePolicyNo ?? ''}, context: context).toText12(isBold: true, color: AppColors.lightGrayColor), ], ), AppCustomChipWidget( icon: isInsuranceExpired ? AppAssets.cancel_circle_icon : AppAssets.insurance_active_icon, - labelText: isInsuranceExpired ? "Insurance Expired".needTranslation : "Insurance Active".needTranslation, + labelText: isInsuranceExpired ? LocaleKeys.insuranceExpired.tr(context: context) : LocaleKeys.insuranceActive.tr(context: context), iconColor: isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor, textColor: isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor, iconSize: 12, @@ -78,7 +78,7 @@ class PatientInsuranceCard extends StatelessWidget { labelText: "${LocaleKeys.expiryDate.tr(context: context)} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceCardDetailsModel.cardValidTo), false)}", labelPadding: EdgeInsetsDirectional.only(start: -4.h, end: 8.h), ), - AppCustomChipWidget(labelText: "Patient Card ID: ${insuranceCardDetailsModel.patientCardID}".needTranslation), + AppCustomChipWidget(labelText: LocaleKeys.patientCardID.tr(namedArgs: {'id': insuranceCardDetailsModel.patientCardID ?? ''}, context: context)), ], ), SizedBox(height: 10.h), diff --git a/lib/presentation/lab/lab_order_by_test.dart b/lib/presentation/lab/lab_order_by_test.dart index 837f482..2e4a96b 100644 --- a/lib/presentation/lab/lab_order_by_test.dart +++ b/lib/presentation/lab/lab_order_by_test.dart @@ -44,7 +44,7 @@ class LabOrderByTest extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppCustomChipWidget( - richText: '${"Last Tested:".needTranslation} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(tests!.createdOn), false)}'.toText12(fontWeight: FontWeight.w500), + richText: '${"${LocaleKeys.lastTested.tr(context: context)}:"} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(tests!.createdOn), false)}'.toText12(fontWeight: FontWeight.w500), backgroundColor: AppColors.greyLightColor, textColor: AppColors.textColor, ), diff --git a/lib/presentation/lab/lab_orders_page.dart b/lib/presentation/lab/lab_orders_page.dart index 90651f1..799f574 100644 --- a/lib/presentation/lab/lab_orders_page.dart +++ b/lib/presentation/lab/lab_orders_page.dart @@ -1 +1 @@ -import 'dart:async'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart'; import 'package:hmg_patient_app_new/presentation/lab/search_lab_report.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_toolbar.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart'; import 'package:hmg_patient_app_new/widgets/date_range_selector/viewmodel/date_range_view_model.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:provider/provider.dart'; import 'alphabeticScroll.dart'; class LabOrdersPage extends StatefulWidget { const LabOrdersPage({super.key}); @override State createState() => _LabOrdersPageState(); } class _LabOrdersPageState extends State { late LabViewModel labProvider; late DateRangeSelectorRangeViewModel rangeViewModel; late AppState _appState; List?> labSuggestions = []; int? expandedIndex; String? selectedFilterText = ''; int activeIndex = 0; @override void initState() { scheduleMicrotask(() { labProvider.initLabProvider(); }); super.initState(); } @override Widget build(BuildContext context) { labProvider = Provider.of(context, listen: false); rangeViewModel = Provider.of(context); _appState = getIt(); return CollapsingToolbar( title: LocaleKeys.labResults.tr(), search: () async { final lavVM = Provider.of(context, listen: false); if (lavVM.isLabOrdersLoading) { return; } else { String? value = await Navigator.of(context).push( CustomPageRoute( page: SearchLabResultsContent(labSuggestionsList: lavVM.labSuggestions), fullScreenDialog: true, direction: AxisDirection.down, ), ); if (value != null) { selectedFilterText = value; lavVM.filterLabReports(value); } } }, child: Consumer( builder: (context, model, child) { return SingleChildScrollView( physics: AlwaysScrollableScrollPhysics(), padding: EdgeInsets.all(24.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Expanded( child: CustomTabBar( activeTextColor: Color(0xffED1C2B), activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1), tabs: [ CustomTabBarModel(null, "By Visit".needTranslation), CustomTabBarModel(null, "By Test".needTranslation), // CustomTabBarModel(null, "Completed".needTranslation), ], onTabChange: (index) { activeIndex = index; setState(() {}); }, ), ), ], ), if (activeIndex == 0) Padding( padding: EdgeInsets.symmetric(vertical: 10.h), child: Row( children: [ CustomButton( text: LocaleKeys.byClinic.tr(context: context), onPressed: () { model.setIsSortByClinic(true); }, backgroundColor: model.isSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor, borderColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withValues(alpha: 0.2), textColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor, fontSize: 12, fontWeight: FontWeight.w500, borderRadius: 10, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 40.h, ), SizedBox(width: 8.h), CustomButton( text: LocaleKeys.byHospital.tr(context: context), onPressed: () { model.setIsSortByClinic(false); }, backgroundColor: model.isSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor, borderColor: model.isSortByClinic ? AppColors.textColor.withValues(alpha: 0.2) : AppColors.primaryRedColor, textColor: model.isSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor, fontSize: 12, fontWeight: FontWeight.w500, borderRadius: 10, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 40.h, ), ], ), ), SizedBox(height: 8.h), selectedFilterText!.isNotEmpty ? CustomChipWidget( chipText: selectedFilterText!, chipType: ChipTypeEnum.alert, isSelected: true, ) : SizedBox(), activeIndex == 0 ? // By Visit - show grouped view when available model.isLabOrdersLoading ? ListView.builder( shrinkWrap: true, physics: AlwaysScrollableScrollPhysics(), padding: EdgeInsets.zero, itemCount: 5, itemBuilder: (context, index) => LabResultItemView( onTap: () {}, labOrder: null, index: index, isLoading: true, ), ) : (model.patientLabOrdersViewList.isNotEmpty ? ListView.builder( shrinkWrap: true, physics: AlwaysScrollableScrollPhysics(), padding: EdgeInsets.zero, itemCount: model.patientLabOrdersViewList.length, itemBuilder: (context, index) { final group = model.patientLabOrdersViewList[index]; final isExpanded = expandedIndex == index; return AnimationConfiguration.staggeredList( position: index, duration: const Duration(milliseconds: 500), child: SlideAnimation( verticalOffset: 100.0, child: FadeInAnimation( child: AnimatedContainer( duration: Duration(milliseconds: 300), curve: Curves.easeInOut, margin: EdgeInsets.symmetric(vertical: 8.h), decoration: RoundedRectangleBorder() .toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true), child: InkWell( onTap: () { setState(() { expandedIndex = isExpanded ? null : index; }); }, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.all(16.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppCustomChipWidget(labelText: "${group.length} ${'results'.needTranslation}"), Icon(isExpanded ? Icons.expand_less : Icons.expand_more), ], ), SizedBox(height: 8.h), Text( model.isSortByClinic ? (group.first.clinicDescription ?? 'Unknown') : (group.first.projectName ?? 'Unknown'), style: TextStyle(fontSize: 16.h, fontWeight: FontWeight.w600), overflow: TextOverflow.ellipsis, ), ], ), ), AnimatedSwitcher( duration: Duration(milliseconds: 500), switchInCurve: Curves.easeIn, switchOutCurve: Curves.easeOut, transitionBuilder: (Widget child, Animation animation) { return FadeTransition( opacity: animation, child: SizeTransition( sizeFactor: animation, axisAlignment: 0.0, child: child, ), ); }, child: isExpanded ? Container( key: ValueKey(index), padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ ...group.map((order) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.min, children: [ Image.network( order.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", width: 24.w, height: 24.h, fit: BoxFit.cover, ).circle(100), SizedBox(width: 8.h), Expanded(child: (order.doctorName ?? order.doctorNameEnglish ?? "").toString().toText14(weight: FontWeight.w500)), ], ), SizedBox(height: 8.h), Wrap( direction: Axis.horizontal, spacing: 4.h, runSpacing: 4.h, children: [ AppCustomChipWidget( labelText: ("Order No: ".needTranslation + order.orderNo!), ), AppCustomChipWidget( labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.orderDate ?? ""), false), ), AppCustomChipWidget( labelText: model.isSortByClinic ? (order.clinicDescription ?? "") : (order.projectName ?? ""), ), ], ), // Row( // children: [ // CustomButton( // text: ("Order No: ".needTranslation + order.orderNo!), // onPressed: () {}, // backgroundColor: AppColors.greyColor, // borderColor: AppColors.greyColor, // textColor: AppColors.blackColor, // fontSize: 10, // fontWeight: FontWeight.w500, // borderRadius: 8, // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // height: 24.h, // ), // SizedBox(width: 8.h), // CustomButton( // text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.orderDate ?? ""), false), // onPressed: () {}, // backgroundColor: AppColors.greyColor, // borderColor: AppColors.greyColor, // textColor: AppColors.blackColor, // fontSize: 10, // fontWeight: FontWeight.w500, // borderRadius: 8, // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // height: 24.h, // ), // ], // ), // SizedBox(height: 8.h), // Row( // children: [ // CustomButton( // text: model.isSortByClinic ? (order.clinicDescription ?? "") : (order.projectName ?? ""), // onPressed: () {}, // backgroundColor: AppColors.greyColor, // borderColor: AppColors.greyColor, // textColor: AppColors.blackColor, // fontSize: 10, // fontWeight: FontWeight.w500, // borderRadius: 8, // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // height: 24.h, // ), // ], // ), SizedBox(height: 12.h), Row( children: [ Expanded(flex: 2, child: SizedBox()), // Expanded( // flex: 1, // child: Container( // height: 40.h, // width: 40.w, // decoration: RoundedRectangleBorder().toSmoothCornerDecoration( // color: AppColors.textColor, // borderRadius: 12, // ), // child: Padding( // padding: EdgeInsets.all(12.h), // child: Transform.flip( // flipX: _appState.isArabic(), // child: Utils.buildSvgWithAssets( // icon: AppAssets.forward_arrow_icon_small, // iconColor: AppColors.whiteColor, // fit: BoxFit.contain, // ), // ), // ), // ).onPress(() { // model.currentlySelectedPatientOrder = order; // labProvider.getPatientLabResultByHospital(order); // labProvider.getPatientSpecialResult(order); // Navigator.of(context).push( // CustomPageRoute(page: LabResultByClinic(labOrder: order)), // ); // }), // ) Expanded( flex:2, child: CustomButton( icon: AppAssets.view_report_icon, iconColor: AppColors.primaryRedColor, iconSize: 16.h, text: "View Results".needTranslation, onPressed: () { model.currentlySelectedPatientOrder = order; labProvider.getPatientLabResultByHospital(order); labProvider.getPatientSpecialResult(order); Navigator.of(context).push( CustomPageRoute(page: LabResultByClinic(labOrder: order)), ); }, backgroundColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor, textColor: AppColors.primaryRedColor, fontSize: 14, fontWeight: FontWeight.w500, borderRadius: 12, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 40.h, ), ) ], ), SizedBox(height: 12.h), Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), SizedBox(height: 12.h), ], ); }).toList(), ], ), ) : SizedBox.shrink(), ), ], ), ), ), ), )); }, ) : Utils.getNoDataWidget(context, noDataText: "You don't have any lab results yet.".needTranslation)) : // By Test or other tabs keep existing behavior (model.isLabOrdersLoading) ? Column( children: List.generate( 5, (index) => LabResultItemView( onTap: () {}, labOrder: null, index: index, isLoading: true, )), ) : AlphabeticScroll( alpahbetsAvailable: model.indexedCharacterForUniqueTest, details: model.uniqueTestsList, labViewModel: model, rangeViewModel: rangeViewModel, appState: _appState, ) ], ) ); }, ), ); } Color getLabOrderStatusColor(num status) { switch (status) { case 44: return AppColors.warningColorYellow; case 45: return AppColors.warningColorYellow; case 16: return AppColors.successColor; case 17: return AppColors.successColor; default: return AppColors.greyColor; } } String getLabOrderStatusText(num status) { switch (status) { case 44: return LocaleKeys.resultsPending.tr(context: context); case 45: return LocaleKeys.resultsPending.tr(context: context); case 16: return LocaleKeys.resultsAvailable.tr(context: context); case 17: return LocaleKeys.resultsAvailable.tr(context: context); default: return ""; } } getLabSuggestions(LabViewModel model) { if (model.patientLabOrders.isEmpty) { return []; } return model.patientLabOrders.map((m) => m.testDetails).toList(); } } \ No newline at end of file +import 'dart:async'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart'; import 'package:hmg_patient_app_new/presentation/lab/search_lab_report.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_toolbar.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart'; import 'package:hmg_patient_app_new/widgets/date_range_selector/viewmodel/date_range_view_model.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:provider/provider.dart'; import 'alphabeticScroll.dart'; class LabOrdersPage extends StatefulWidget { const LabOrdersPage({super.key}); @override State createState() => _LabOrdersPageState(); } class _LabOrdersPageState extends State { late LabViewModel labProvider; late DateRangeSelectorRangeViewModel rangeViewModel; late AppState _appState; List?> labSuggestions = []; int? expandedIndex; String? selectedFilterText = ''; int activeIndex = 0; @override void initState() { scheduleMicrotask(() { labProvider.initLabProvider(); }); super.initState(); } @override Widget build(BuildContext context) { labProvider = Provider.of(context, listen: false); rangeViewModel = Provider.of(context); _appState = getIt(); return CollapsingToolbar( title: LocaleKeys.labResults.tr(), search: () async { final lavVM = Provider.of(context, listen: false); if (lavVM.isLabOrdersLoading) { return; } else { String? value = await Navigator.of(context).push( CustomPageRoute( page: SearchLabResultsContent(labSuggestionsList: lavVM.labSuggestions), fullScreenDialog: true, direction: AxisDirection.down, ), ); if (value != null) { selectedFilterText = value; lavVM.filterLabReports(value); } } }, child: Consumer( builder: (context, model, child) { return SingleChildScrollView( physics: AlwaysScrollableScrollPhysics(), padding: EdgeInsets.all(24.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Expanded( child: CustomTabBar( activeTextColor: Color(0xffED1C2B), activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1), tabs: [ CustomTabBarModel(null, LocaleKeys.byVisit.tr()), CustomTabBarModel(null, LocaleKeys.byTest.tr()), // CustomTabBarModel(null, "Completed".needTranslation), ], onTabChange: (index) { activeIndex = index; setState(() {}); }, ), ), ], ), if (activeIndex == 0) Padding( padding: EdgeInsets.symmetric(vertical: 10.h), child: Row( children: [ CustomButton( text: LocaleKeys.byClinic.tr(context: context), onPressed: () { model.setIsSortByClinic(true); }, backgroundColor: model.isSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor, borderColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withValues(alpha: 0.2), textColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor, fontSize: 12, fontWeight: FontWeight.w500, borderRadius: 10, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 40.h, ), SizedBox(width: 8.h), CustomButton( text: LocaleKeys.byHospital.tr(context: context), onPressed: () { model.setIsSortByClinic(false); }, backgroundColor: model.isSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor, borderColor: model.isSortByClinic ? AppColors.textColor.withValues(alpha: 0.2) : AppColors.primaryRedColor, textColor: model.isSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor, fontSize: 12, fontWeight: FontWeight.w500, borderRadius: 10, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 40.h, ), ], ), ), SizedBox(height: 8.h), selectedFilterText!.isNotEmpty ? CustomChipWidget( chipText: selectedFilterText!, chipType: ChipTypeEnum.alert, isSelected: true, ) : SizedBox(), activeIndex == 0 ? // By Visit - show grouped view when available model.isLabOrdersLoading ? ListView.builder( shrinkWrap: true, physics: AlwaysScrollableScrollPhysics(), padding: EdgeInsets.zero, itemCount: 5, itemBuilder: (context, index) => LabResultItemView( onTap: () {}, labOrder: null, index: index, isLoading: true, ), ) : (model.patientLabOrdersViewList.isNotEmpty ? ListView.builder( shrinkWrap: true, physics: AlwaysScrollableScrollPhysics(), padding: EdgeInsets.zero, itemCount: model.patientLabOrdersViewList.length, itemBuilder: (context, index) { final group = model.patientLabOrdersViewList[index]; final isExpanded = expandedIndex == index; return AnimationConfiguration.staggeredList( position: index, duration: const Duration(milliseconds: 500), child: SlideAnimation( verticalOffset: 100.0, child: FadeInAnimation( child: AnimatedContainer( duration: Duration(milliseconds: 300), curve: Curves.easeInOut, margin: EdgeInsets.symmetric(vertical: 8.h), decoration: RoundedRectangleBorder() .toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true), child: InkWell( onTap: () { setState(() { expandedIndex = isExpanded ? null : index; }); }, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.all(16.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppCustomChipWidget(labelText: "${group.length} ${LocaleKeys.results.tr(context: context)}"), Icon(isExpanded ? Icons.expand_less : Icons.expand_more), ], ), SizedBox(height: 8.h), Text( model.isSortByClinic ? (group.first.clinicDescription ?? 'Unknown') : (group.first.projectName ?? 'Unknown'), style: TextStyle(fontSize: 16.h, fontWeight: FontWeight.w600), overflow: TextOverflow.ellipsis, ), ], ), ), AnimatedSwitcher( duration: Duration(milliseconds: 500), switchInCurve: Curves.easeIn, switchOutCurve: Curves.easeOut, transitionBuilder: (Widget child, Animation animation) { return FadeTransition( opacity: animation, child: SizeTransition( sizeFactor: animation, axisAlignment: 0.0, child: child, ), ); }, child: isExpanded ? Container( key: ValueKey(index), padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ ...group.map((order) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.min, children: [ Image.network( order.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", width: 24.w, height: 24.h, fit: BoxFit.cover, ).circle(100), SizedBox(width: 8.h), Expanded(child: (order.doctorName ?? order.doctorNameEnglish ?? "").toString().toText14(weight: FontWeight.w500)), ], ), SizedBox(height: 8.h), Wrap( direction: Axis.horizontal, spacing: 4.h, runSpacing: 4.h, children: [ AppCustomChipWidget( labelText: ("${LocaleKeys.orderNo.tr()}: ${order.orderNo!}"), ), AppCustomChipWidget( labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.orderDate ?? ""), false), ), AppCustomChipWidget( labelText: model.isSortByClinic ? (order.clinicDescription ?? "") : (order.projectName ?? ""), ), ], ), // Row( // children: [ // CustomButton( // text: ("Order No: ".needTranslation + order.orderNo!), // onPressed: () {}, // backgroundColor: AppColors.greyColor, // borderColor: AppColors.greyColor, // textColor: AppColors.blackColor, // fontSize: 10, // fontWeight: FontWeight.w500, // borderRadius: 8, // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // height: 24.h, // ), // SizedBox(width: 8.h), // CustomButton( // text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.orderDate ?? ""), false), // onPressed: () {}, // backgroundColor: AppColors.greyColor, // borderColor: AppColors.greyColor, // textColor: AppColors.blackColor, // fontSize: 10, // fontWeight: FontWeight.w500, // borderRadius: 8, // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // height: 24.h, // ), // ], // ), // SizedBox(height: 8.h), // Row( // children: [ // CustomButton( // text: model.isSortByClinic ? (order.clinicDescription ?? "") : (order.projectName ?? ""), // onPressed: () {}, // backgroundColor: AppColors.greyColor, // borderColor: AppColors.greyColor, // textColor: AppColors.blackColor, // fontSize: 10, // fontWeight: FontWeight.w500, // borderRadius: 8, // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // height: 24.h, // ), // ], // ), SizedBox(height: 12.h), Row( children: [ Expanded(flex: 2, child: SizedBox()), // Expanded( // flex: 1, // child: Container( // height: 40.h, // width: 40.w, // decoration: RoundedRectangleBorder().toSmoothCornerDecoration( // color: AppColors.textColor, // borderRadius: 12, // ), // child: Padding( // padding: EdgeInsets.all(12.h), // child: Transform.flip( // flipX: _appState.isArabic(), // child: Utils.buildSvgWithAssets( // icon: AppAssets.forward_arrow_icon_small, // iconColor: AppColors.whiteColor, // fit: BoxFit.contain, // ), // ), // ), // ).onPress(() { // model.currentlySelectedPatientOrder = order; // labProvider.getPatientLabResultByHospital(order); // labProvider.getPatientSpecialResult(order); // Navigator.of(context).push( // CustomPageRoute(page: LabResultByClinic(labOrder: order)), // ); // }), // ) Expanded( flex:2, child: CustomButton( icon: AppAssets.view_report_icon, iconColor: AppColors.primaryRedColor, iconSize: 16.h, text: LocaleKeys.viewResults.tr(context: context), onPressed: () { model.currentlySelectedPatientOrder = order; labProvider.getPatientLabResultByHospital(order); labProvider.getPatientSpecialResult(order); Navigator.of(context).push( CustomPageRoute(page: LabResultByClinic(labOrder: order)), ); }, backgroundColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor, textColor: AppColors.primaryRedColor, fontSize: 14, fontWeight: FontWeight.w500, borderRadius: 12, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 40.h, ), ) ], ), SizedBox(height: 12.h), Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), SizedBox(height: 12.h), ], ); }), ], ), ) : SizedBox.shrink(), ), ], ), ), ), ), )); }, ) : Utils.getNoDataWidget(context, noDataText: LocaleKeys.noLabResults.tr(context: context))) : // By Test or other tabs keep existing behavior (model.isLabOrdersLoading) ? Column( children: List.generate( 5, (index) => LabResultItemView( onTap: () {}, labOrder: null, index: index, isLoading: true, )), ) : AlphabeticScroll( alpahbetsAvailable: model.indexedCharacterForUniqueTest, details: model.uniqueTestsList, labViewModel: model, rangeViewModel: rangeViewModel, appState: _appState, ) ], ) ); }, ), ); } Color getLabOrderStatusColor(num status) { switch (status) { case 44: return AppColors.warningColorYellow; case 45: return AppColors.warningColorYellow; case 16: return AppColors.successColor; case 17: return AppColors.successColor; default: return AppColors.greyColor; } } String getLabOrderStatusText(num status) { switch (status) { case 44: return LocaleKeys.resultsPending.tr(context: context); case 45: return LocaleKeys.resultsPending.tr(context: context); case 16: return LocaleKeys.resultsAvailable.tr(context: context); case 17: return LocaleKeys.resultsAvailable.tr(context: context); default: return ""; } } getLabSuggestions(LabViewModel model) { if (model.patientLabOrders.isEmpty) { return []; } return model.patientLabOrders.map((m) => m.testDetails).toList(); } } \ No newline at end of file diff --git a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart index ad4a032..50fd1f1 100644 --- a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart +++ b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart @@ -89,9 +89,9 @@ class LabResultByClinic extends StatelessWidget { hasShadow: true, ), child: CustomButton( - text: "Download report".needTranslation, + text: LocaleKeys.downloadReport.tr(context: context), onPressed: () async { - LoaderBottomSheet.showLoader(loadingText: "Generating report, Please wait...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.generatingReport.tr(context: context)); await labViewModel .getLabResultReportPDF( labOrder: labOrder, @@ -114,7 +114,7 @@ class LabResultByClinic extends StatelessWidget { } catch (ex) { showCommonBottomSheetWithoutHeight( context, - child: Utils.getErrorWidget(loadingText: "Cannot open file".needTranslation), + child: Utils.getErrorWidget(loadingText: "Cannot open file"), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, diff --git a/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart b/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart index 3f05443..6caa4a5 100644 --- a/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart +++ b/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart @@ -1,8 +1,10 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; import 'package:hmg_patient_app_new/features/lab/models/resp_models/lab_result.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart'; import 'package:provider/provider.dart' show Selector, Provider, ReadContext; @@ -17,8 +19,7 @@ class LabResultList extends StatelessWidget { builder: (__, list, ___) { if (list.isEmpty && context.read().labSpecialResult.isEmpty) { return Utils.getNoDataWidget(context, - noDataText: "You don't have any lab results yet." - .needTranslation); + noDataText: LocaleKeys.noLabResults.tr(context: context)); } else { return ListView.builder( physics: NeverScrollableScrollPhysics(), diff --git a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart index c6841b3..e332066 100644 --- a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart +++ b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart @@ -71,7 +71,7 @@ class LabOrderResultItem extends StatelessWidget { child: Visibility( visible: tests?.referanceRange != null, child: Text( - "(Reference range: ${tests?.referanceRange})".needTranslation, + "(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})", style: TextStyle( fontSize: 12.f, fontWeight: FontWeight.w500, diff --git a/lib/presentation/lab/lab_results/lab_result_details.dart b/lib/presentation/lab/lab_results/lab_result_details.dart index 1d54e06..eb39fef 100644 --- a/lib/presentation/lab/lab_results/lab_result_details.dart +++ b/lib/presentation/lab/lab_results/lab_result_details.dart @@ -32,7 +32,7 @@ class LabResultDetails extends StatelessWidget { @override Widget build(BuildContext context) { return CollapsingListView( - title: 'Lab Result Details'.needTranslation, + title: LocaleKeys.labResultDetails.tr(context: context), child: SingleChildScrollView( child: Column( spacing: 16.h, @@ -89,7 +89,7 @@ class LabResultDetails extends StatelessWidget { ], ), SizedBox(height: 4.h), - ("Result of ${recentLabResult.verifiedOn ?? ""}".needTranslation).toText11(weight: FontWeight.w500, color: AppColors.greyTextColor), + ("${LocaleKeys.resultOf.tr(context: context)} ${recentLabResult.verifiedOn ?? ""}").toText11(weight: FontWeight.w500, color: AppColors.greyTextColor), ], ), Row( @@ -116,7 +116,7 @@ class LabResultDetails extends StatelessWidget { Visibility( visible: recentLabResult.referanceRange != null, child: Text( - "Reference range: \n${recentLabResult.referanceRange!.trim()}".needTranslation, + "${LocaleKeys.referenceRange.tr(context: context)}: \n${recentLabResult.referanceRange!.trim()}", style: TextStyle( fontSize: 12.f, fontWeight: FontWeight.w500, @@ -261,13 +261,15 @@ class LabResultDetails extends StatelessWidget { leftLabelFormatter: (value) { value = double.parse(value.toStringAsFixed(1)); // return leftLabels(value.toStringAsFixed(2)); - if(value == labmodel.highRefrenceValue) - return leftLabels("High".needTranslation); + if (value == labmodel.highRefrenceValue) { + return leftLabels(LocaleKeys.high.tr()); + } - if(value== labmodel.lowRefenceValue) - return leftLabels("Low".needTranslation); + if (value == labmodel.lowRefenceValue) { + return leftLabels(LocaleKeys.low.tr()); + } - return SizedBox.shrink(); + return SizedBox.shrink(); // } }, graphColor:AppColors.blackColor, @@ -366,8 +368,7 @@ class LabResultDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, spacing: 8.h, children: [ - "What is this result?" - .needTranslation + LocaleKeys.whatIsThisResult.tr(context: context) .toText16(weight: FontWeight.w600, color: AppColors.textColor), testDescription?.toText12( fontWeight: FontWeight.w500, color: AppColors.textColorLight) ?? diff --git a/lib/presentation/medical_file/eye_measurement_details_page.dart b/lib/presentation/medical_file/eye_measurement_details_page.dart index 0662cb1..0822609 100644 --- a/lib/presentation/medical_file/eye_measurement_details_page.dart +++ b/lib/presentation/medical_file/eye_measurement_details_page.dart @@ -96,7 +96,7 @@ class EyeMeasurementDetailsPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.leftEye.tr().needTranslation.toText14(isBold: true), + LocaleKeys.leftEye.tr().toText14(isBold: true), SizedBox(height: 16.h), getRow(LocaleKeys.sphere.tr(), '${patientAppointmentHistoryResponseModel.listHISGetGlassPrescription![0].leftEyeSpherical}', '-'), getRow(LocaleKeys.cylinder.tr(), '${patientAppointmentHistoryResponseModel.listHISGetGlassPrescription![0].leftEyeCylinder}', '-'), @@ -139,7 +139,7 @@ class EyeMeasurementDetailsPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.leftEye.tr().needTranslation.toText14(isBold: true), + LocaleKeys.leftEye.tr().toText14(isBold: true), SizedBox(height: 16.h), getRow(LocaleKeys.brand.tr(), '${patientAppointmentHistoryResponseModel.listHISGetContactLensPrescription![1].brand}', ''), getRow('B.C', '${patientAppointmentHistoryResponseModel.listHISGetContactLensPrescription![1].baseCurve}', ''), diff --git a/lib/presentation/medical_file/eye_measurements_appointments_page.dart b/lib/presentation/medical_file/eye_measurements_appointments_page.dart index 3b82ad4..d8438ba 100644 --- a/lib/presentation/medical_file/eye_measurements_appointments_page.dart +++ b/lib/presentation/medical_file/eye_measurements_appointments_page.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; @@ -7,6 +8,7 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_card.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; @@ -75,7 +77,7 @@ class EyeMeasurementsAppointmentsPage extends StatelessWidget { ), ), ) - : Utils.getNoDataWidget(context, noDataText: "No Ophthalmology appointments found...".needTranslation); + : Utils.getNoDataWidget(context, noDataText: LocaleKeys.noOphthalmologyAppointments.tr(context: context)); }, separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), ), diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index c6ff85f..ad2461f 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -195,8 +195,8 @@ class _MedicalFilePageState extends State { ).withHorizontalPadding(24.w).onPress(() { DialogService dialogService = getIt.get(); dialogService.showFamilyBottomSheetWithoutH( - label: "Family Files".needTranslation, - message: "This clinic or doctor is only available for the below eligible profiles.".needTranslation, + label: LocaleKeys.familyTitle.tr(context: context), + message: "", onSwitchPress: (FamilyFileResponseModelLists profile) { medicalFileViewModel.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber); }, @@ -289,7 +289,7 @@ class _MedicalFilePageState extends State { Consumer(builder: (context, insuranceVM, child) { return AppCustomChipWidget( icon: insuranceVM.isInsuranceExpired ? AppAssets.cancel_circle_icon : AppAssets.insurance_active_icon, - labelText: insuranceVM.isInsuranceExpired ? "Insurance Expired".needTranslation : "Insurance Active".needTranslation, + labelText: insuranceVM.isInsuranceExpired ? LocaleKeys.insuranceExpired.tr(context: context) : LocaleKeys.insuranceActive.tr(context: context), iconColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor, textColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor, iconSize: 12.w, @@ -316,7 +316,7 @@ class _MedicalFilePageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Vital Signs".needTranslation.toText16(weight: FontWeight.w500, letterSpacing: -0.2), + LocaleKeys.vitalSigns.tr(context: context).toText16(weight: FontWeight.w500, letterSpacing: -0.2), Row( children: [ LocaleKeys.viewAll.tr().toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500), @@ -359,7 +359,7 @@ class _MedicalFilePageState extends State { children: [ Utils.buildSvgWithAssets(icon: AppAssets.call_for_vitals, width: 32.h, height: 32.h), SizedBox(height: 12.h), - "No vital signs recorded yet".needTranslation.toText12(isCenter: true), + LocaleKeys.noVitalSignsRecordedYet.tr().toText12(isCenter: true), ], ), ), @@ -417,20 +417,20 @@ class _MedicalFilePageState extends State { }), SizedBox(height: 16.h), - TextInputWidget( - labelText: LocaleKeys.search.tr(context: context), - hintText: "Type any record".needTranslation, - controller: TextEditingController(), - keyboardType: TextInputType.number, - isEnable: true, - prefix: null, - autoFocus: false, - isBorderAllowed: false, - isAllowLeadingIcon: true, - padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h), - leadingIcon: AppAssets.search_icon, - hintColor: AppColors.textColor, - ).paddingSymmetrical(24.w, 0.0), + // TextInputWidget( + // labelText: LocaleKeys.search.tr(context: context), + // hintText: "Type any record".needTranslation, + // controller: TextEditingController(), + // keyboardType: TextInputType.number, + // isEnable: true, + // prefix: null, + // autoFocus: false, + // isBorderAllowed: false, + // isAllowLeadingIcon: true, + // padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h), + // leadingIcon: AppAssets.search_icon, + // hintColor: AppColors.textColor, + // ).paddingSymmetrical(24.w, 0.0), SizedBox(height: 16.h), // Using CustomExpandableList CustomExpandableList( @@ -547,7 +547,7 @@ class _MedicalFilePageState extends State { onSuccess: (dynamic respData) async { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( - title: "Pick a Date".needTranslation, + title: LocaleKeys.pickADate.tr(context: context), context, child: AppointmentCalendar(), isFullScreen: false, @@ -577,7 +577,7 @@ class _MedicalFilePageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Appointments & visits".needTranslation.toText16(weight: FontWeight.w500, letterSpacing: -0.2), + LocaleKeys.appointmentsAndVisits.tr().toText16(weight: FontWeight.w500, letterSpacing: -0.2), Row( children: [ LocaleKeys.viewAll.tr().toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500), @@ -615,7 +615,7 @@ class _MedicalFilePageState extends State { children: [ Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h), SizedBox(height: 12.h), - "You do not have any appointments. Please book an appointment".needTranslation.toText12(isCenter: true), + LocaleKeys.noUpcomingAppointmentPleaseBook.tr(context: context).toText12(isCenter: true), SizedBox(height: 12.h), CustomButton( text: LocaleKeys.bookAppo.tr(context: context), @@ -662,7 +662,7 @@ class _MedicalFilePageState extends State { openDoctorScheduleCalendar(myAppointmentsVM.patientAppointmentsHistoryList[index]); }, onAskDoctorTap: () async { - LoaderBottomSheet.showLoader(loadingText: "Checking doctor availability...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingDoctorAvailability.tr(context: context)); await myAppointmentsViewModel.isDoctorAvailable( projectID: myAppointmentsVM.patientAppointmentsHistoryList[index].projectID, doctorId: myAppointmentsVM.patientAppointmentsHistoryList[index].doctorID, @@ -687,7 +687,6 @@ class _MedicalFilePageState extends State { }); } else { LoaderBottomSheet.hideLoader(); - print("Doctor is not available"); } }, onError: (_) { @@ -705,7 +704,7 @@ class _MedicalFilePageState extends State { ).paddingSymmetrical(0.w, 0.h); }), SizedBox(height: 10.h), - "Lab & Radiology".needTranslation.toText16(weight: FontWeight.w500, letterSpacing: -0.2), + LocaleKeys.labAndRadiology.tr().toText16(weight: FontWeight.w500, letterSpacing: -0.2), SizedBox(height: 16.h), Row( children: [ @@ -728,7 +727,7 @@ class _MedicalFilePageState extends State { Expanded( child: LabRadCard( icon: AppAssets.radiology_icon, - labelText: "${LocaleKeys.radiology.tr(context: context)} Results".needTranslation, + labelText: "${LocaleKeys.radiology.tr(context: context)} ${LocaleKeys.results.tr(context: context)}", // labOrderTests: ["Complete blood count", "Creatinine", "Blood Sugar", // labOrderTests: ["Chest X-ray", "Abdominal Ultrasound", "Dental X-ray"], labOrderTests: [], @@ -744,7 +743,7 @@ class _MedicalFilePageState extends State { ], ).paddingSymmetrical(0.w, 0.h), SizedBox(height: 24.h), - "Active Medications & Prescriptions".needTranslation.toText16(weight: FontWeight.w500, letterSpacing: -0.2), + LocaleKeys.activeMedicationsAndPrescriptions.tr().toText16(weight: FontWeight.w500, letterSpacing: -0.2), SizedBox(height: 16.h), Consumer(builder: (context, prescriptionVM, child) { return prescriptionVM.isPrescriptionsOrdersLoading @@ -836,7 +835,7 @@ class _MedicalFilePageState extends State { children: [ Expanded( child: CustomButton( - text: "All Prescriptions".needTranslation, + text: LocaleKeys.allPrescriptions.tr(context: context), onPressed: () { Navigator.of(context).push( CustomPageRoute( @@ -859,7 +858,7 @@ class _MedicalFilePageState extends State { SizedBox(width: 6.w), Expanded( child: CustomButton( - text: "All Medications".needTranslation, + text: LocaleKeys.allMedications.tr(context: context), onPressed: () {}, backgroundColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor, @@ -887,7 +886,7 @@ class _MedicalFilePageState extends State { ), child: Utils.getNoDataWidget( context, - noDataText: "You don't have any prescriptions yet.".needTranslation, + noDataText: LocaleKeys.youDontHaveAnyPrescriptionsYet.tr(context: context), isSmallWidget: true, width: 62.w, height: 62.h, @@ -945,7 +944,7 @@ class _MedicalFilePageState extends State { ), child: Utils.getNoDataWidget( context, - noDataText: "You don't have any completed visits yet".needTranslation, + noDataText: LocaleKeys.youDontHaveAnyCompletedVisitsYet.tr(context: context), isSmallWidget: true, width: 62.w, height: 62.h, @@ -1017,7 +1016,7 @@ class _MedicalFilePageState extends State { ).paddingSymmetrical(0.w, 0); }), SizedBox(height: 24.h), - "Others".needTranslation.toText16(weight: FontWeight.w500, letterSpacing: -0.2), + LocaleKeys.others.tr(context: context).toText16(weight: FontWeight.w500, letterSpacing: -0.2), SizedBox(height: 16.h), GridView( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( @@ -1031,7 +1030,7 @@ class _MedicalFilePageState extends State { shrinkWrap: true, children: [ MedicalFileCard( - label: "Eye Test Results".needTranslation, + label: LocaleKeys.eyeMeasurements.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.eye_result_icon, @@ -1048,7 +1047,7 @@ class _MedicalFilePageState extends State { ); }), MedicalFileCard( - label: "Allergy Info".needTranslation, + label: LocaleKeys.allergyInfo.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.allergy_info_icon, @@ -1063,7 +1062,7 @@ class _MedicalFilePageState extends State { ); }), MedicalFileCard( - label: "Vaccine Info".needTranslation, + label: LocaleKeys.vaccineInfo.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.vaccine_info_icon, @@ -1108,7 +1107,7 @@ class _MedicalFilePageState extends State { ), child: Utils.getNoDataWidget( context, - noDataText: "You don't have insurance registered with HMG.".needTranslation, + noDataText: LocaleKeys.noInsuranceWithHMG.tr(context: context), isSmallWidget: true, width: 62.w, height: 62.h, @@ -1153,7 +1152,7 @@ class _MedicalFilePageState extends State { shrinkWrap: true, children: [ MedicalFileCard( - label: "Update Insurance".needTranslation, + label: LocaleKeys.updateInsuranceInfo.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.update_insurance_icon, @@ -1177,7 +1176,7 @@ class _MedicalFilePageState extends State { ); }), MedicalFileCard( - label: "My Invoices List".needTranslation, + label: LocaleKeys.myInvoicesList.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.invoices_list_icon, @@ -1191,7 +1190,7 @@ class _MedicalFilePageState extends State { ); }), MedicalFileCard( - label: "Ancillary Orders List".needTranslation, + label: LocaleKeys.ancillaryOrdersList.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.ancillary_orders_list_icon, @@ -1232,7 +1231,7 @@ class _MedicalFilePageState extends State { ), child: Utils.getNoDataWidget( context, - noDataText: "You don't have any sick leaves yet.".needTranslation, + noDataText: LocaleKeys.youDontHaveAnySickLeavesYet.tr(context: context), isSmallWidget: true, width: 62.w, height: 62.h, @@ -1267,7 +1266,7 @@ class _MedicalFilePageState extends State { ); }), MedicalFileCard( - label: "Medical Reports".needTranslation, + label: LocaleKeys.medicalReports.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.medical_reports_icon, @@ -1283,7 +1282,7 @@ class _MedicalFilePageState extends State { ); }), MedicalFileCard( - label: "Sick Leave Report".needTranslation, + label: LocaleKeys.sickLeaveReport.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.sick_leave_report_icon, @@ -1308,7 +1307,7 @@ class _MedicalFilePageState extends State { children: [ Row( children: [ - "Health Trackers".needTranslation.toText16(weight: FontWeight.w500, color: AppColors.textColor), + LocaleKeys.healthTrackers.tr(context: context).toText16(weight: FontWeight.w500, color: AppColors.textColor), ], ), SizedBox(height: 16.h), @@ -1324,7 +1323,7 @@ class _MedicalFilePageState extends State { shrinkWrap: true, children: [ MedicalFileCard( - label: "Blood Sugar".needTranslation, + label: LocaleKeys.bloodSugar.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.blood_sugar_icon, @@ -1332,7 +1331,7 @@ class _MedicalFilePageState extends State { iconSize: 36.w, ).onPress(() => context.navigateWithName(AppRoutes.healthTrackerDetailPage, arguments: HealthTrackerTypeEnum.bloodSugar)), MedicalFileCard( - label: "Blood Pressure".needTranslation, + label: LocaleKeys.bloodPressure.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.lab_result_icon, @@ -1340,7 +1339,7 @@ class _MedicalFilePageState extends State { iconSize: 36.w, ).onPress(() => context.navigateWithName(AppRoutes.healthTrackerDetailPage, arguments: HealthTrackerTypeEnum.bloodPressure)), MedicalFileCard( - label: "Weight Tracker".needTranslation, + label: LocaleKeys.weightTracker.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.weight_tracker_icon, @@ -1352,7 +1351,7 @@ class _MedicalFilePageState extends State { SizedBox(height: 16.h), Row( children: [ - "Others".needTranslation.toText16(weight: FontWeight.w500, color: AppColors.textColor), + LocaleKeys.others.tr().toText16(weight: FontWeight.w500, color: AppColors.textColor), ], ), SizedBox(height: 16.h), @@ -1368,21 +1367,21 @@ class _MedicalFilePageState extends State { shrinkWrap: true, children: [ MedicalFileCard( - label: "Ask Your Doctor".needTranslation, + label: LocaleKeys.askYourDoctor.tr(context: context), textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.ask_doctor_medical_file_icon, isLargeText: true, iconSize: 36.w, ).onPress(() {}), - MedicalFileCard( - label: "Internet Pairing".needTranslation, - textColor: AppColors.blackColor, - backgroundColor: AppColors.whiteColor, - svgIcon: AppAssets.internet_pairing_icon, - isLargeText: true, - iconSize: 36.w, - ).onPress(() {}), + // MedicalFileCard( + // label: LocaleKeys.internetPairing.tr(context: context), + // textColor: AppColors.blackColor, + // backgroundColor: AppColors.whiteColor, + // svgIcon: AppAssets.internet_pairing_icon, + // isLargeText: true, + // iconSize: 36.w, + // ).onPress(() {}), ], ).paddingSymmetrical(0.w, 0.0), SizedBox(height: 24.h), diff --git a/lib/presentation/medical_file/patient_sickleaves_list_page.dart b/lib/presentation/medical_file/patient_sickleaves_list_page.dart index ef5aaeb..fcdb12e 100644 --- a/lib/presentation/medical_file/patient_sickleaves_list_page.dart +++ b/lib/presentation/medical_file/patient_sickleaves_list_page.dart @@ -245,7 +245,7 @@ class _PatientSickleavesListPageState extends State { Expanded( flex: 6, child: CustomButton( - text: "Download Report".needTranslation, + text: LocaleKeys.downloadReport.tr(context: context), onPressed: () async { LoaderBottomSheet.showLoader(); await medicalFileViewModel.getPatientSickLeavePDF(sickLeave, appState.getAuthenticatedUser()!).then((val) async { @@ -293,7 +293,7 @@ class _PatientSickleavesListPageState extends State { ), ), ) - : Utils.getNoDataWidget(context, noDataText: "You don't have any sick leaves yet.".needTranslation); + : Utils.getNoDataWidget(context, noDataText: LocaleKeys.youDontHaveAnySickLeavesYet.tr(context: context)); }, ).paddingSymmetrical(24.h, 0.h), ], diff --git a/lib/presentation/medical_file/vaccine_list_page.dart b/lib/presentation/medical_file/vaccine_list_page.dart index 777426f..bf02cb7 100644 --- a/lib/presentation/medical_file/vaccine_list_page.dart +++ b/lib/presentation/medical_file/vaccine_list_page.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; @@ -9,6 +10,7 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:provider/provider.dart'; @@ -40,7 +42,7 @@ class _VaccineListPageState extends State { return Scaffold( backgroundColor: AppColors.bgScaffoldColor, body: CollapsingListView( - title: "Vaccine Info".needTranslation, + title: LocaleKeys.vaccineInfo.tr(context: context), child: SingleChildScrollView( child: Consumer(builder: (context, medicalFileVM, child) { return Column( @@ -170,7 +172,7 @@ class _VaccineListPageState extends State { ), ), ) - : Utils.getNoDataWidget(context, noDataText: "No vaccines data found...".needTranslation); + : Utils.getNoDataWidget(context, noDataText: LocaleKeys.noDataAvailable.tr(context: context)); }, separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), ), diff --git a/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart b/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart index fbe79bb..3d3624d 100644 --- a/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart +++ b/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart @@ -183,7 +183,7 @@ class MedicalFileAppointmentCard extends StatelessWidget { iconSize: 16.h, ) : CustomButton( - text: "Rebook".needTranslation, + text: LocaleKeys.rebook.tr(context: context), onPressed: () { onRescheduleTap(); }, diff --git a/lib/presentation/medical_file/widgets/patient_sick_leave_card.dart b/lib/presentation/medical_file/widgets/patient_sick_leave_card.dart index 6f9b8b5..16c05d8 100644 --- a/lib/presentation/medical_file/widgets/patient_sick_leave_card.dart +++ b/lib/presentation/medical_file/widgets/patient_sick_leave_card.dart @@ -94,7 +94,7 @@ class PatientSickLeaveCard extends StatelessWidget { : Expanded( flex: 6, child: CustomButton( - text: "Download Report".needTranslation, + text: LocaleKeys.downloadReport.tr(context: context), onPressed: () async { LoaderBottomSheet.showLoader(); await medicalFileViewModel.getPatientSickLeavePDF(patientSickLeavesResponseModel, _appState.getAuthenticatedUser()!).then((val) async { @@ -106,7 +106,7 @@ class PatientSickLeaveCard extends StatelessWidget { } catch (ex) { showCommonBottomSheetWithoutHeight( context, - child: Utils.getErrorWidget(loadingText: "Cannot open file".needTranslation), + child: Utils.getErrorWidget(loadingText: "Cannot open file"), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, diff --git a/lib/presentation/medical_report/medical_report_request_page.dart b/lib/presentation/medical_report/medical_report_request_page.dart index 8eabcdd..47a2df3 100644 --- a/lib/presentation/medical_report/medical_report_request_page.dart +++ b/lib/presentation/medical_report/medical_report_request_page.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; @@ -6,6 +7,7 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_card.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; @@ -20,7 +22,7 @@ class MedicalReportRequestPage extends StatelessWidget { Widget build(BuildContext context) { medicalFileViewModel = Provider.of(context, listen: false); return CollapsingListView( - title: "Medical Reports".needTranslation, + title: LocaleKeys.medicalReports.tr(context: context), isClose: true, child: Column( children: [ diff --git a/lib/presentation/medical_report/medical_reports_page.dart b/lib/presentation/medical_report/medical_reports_page.dart index f6d7576..87420fd 100644 --- a/lib/presentation/medical_report/medical_reports_page.dart +++ b/lib/presentation/medical_report/medical_reports_page.dart @@ -44,7 +44,7 @@ class _MedicalReportsPageState extends State { children: [ Expanded( child: CollapsingListView( - title: "Medical Reports".needTranslation, + title: LocaleKeys.medicalReports.tr(context: context), child: SingleChildScrollView( child: Consumer(builder: (context, medicalFileVM, child) { return Column( @@ -88,7 +88,7 @@ class _MedicalReportsPageState extends State { Row( children: [ CustomButton( - text: "Requested".needTranslation, + text: LocaleKeys.requested.tr(context: context), onPressed: () { setState(() { expandedIndex = null; @@ -300,7 +300,7 @@ class _MedicalReportsPageState extends State { Expanded( flex: 6, child: CustomButton( - text: "Download Report".needTranslation, + text: LocaleKeys.downloadReport.tr(context: context), onPressed: () async { LoaderBottomSheet.showLoader(); await medicalFileViewModel.getPatientMedicalReportPDF(report, appState.getAuthenticatedUser()!).then((val) async { @@ -348,7 +348,7 @@ class _MedicalReportsPageState extends State { ), ), ) - : Utils.getNoDataWidget(context, noDataText: "You don't have any medical reports yet.".needTranslation) + : Utils.getNoDataWidget(context, noDataText: LocaleKeys.youDontHaveAnyMedicalReportsYet.tr(context: context)) .paddingSymmetrical(24.h, 24.h); }, ).paddingSymmetrical(24.h, 0.h), @@ -366,7 +366,7 @@ class _MedicalReportsPageState extends State { hasShadow: true, ), child: CustomButton( - text: "Request medical report".needTranslation, + text: LocaleKeys.requestMedicalReport.tr(context: context), onPressed: () async { LoaderBottomSheet.showLoader(); await medicalFileViewModel.getPatientMedicalReportAppointmentsList(onSuccess: (val) async { @@ -385,7 +385,7 @@ class _MedicalReportsPageState extends State { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( context, - child: Utils.getErrorWidget(loadingText: "You do not have any appointments to request a medical report.".needTranslation), + child: Utils.getErrorWidget(loadingText: LocaleKeys.youDoNotHaveAnyAppointmentsToRequestMedicalReport.tr(context: context)), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, @@ -414,7 +414,7 @@ class _MedicalReportsPageState extends State { title: LocaleKeys.notice.tr(context: context), context, child: Utils.getWarningWidget( - loadingText: "Are you sure you want to request a medical report for this appointment?".needTranslation, + loadingText: LocaleKeys.areYouSureYouWantToRequestMedicalReport.tr(context: context), isShowActionButtons: true, onCancelTap: () { Navigator.pop(context); @@ -425,7 +425,7 @@ class _MedicalReportsPageState extends State { await medicalFileViewModel.insertRequestForMedicalReport(onSuccess: (val) { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight(context, - child: Utils.getSuccessWidget(loadingText: "Your medical report request has been successfully submitted.".needTranslation), + child: Utils.getSuccessWidget(loadingText: LocaleKeys.yourMedicalReportRequestSubmittedSuccessfully.tr(context: context)), callBackFunc: () { medicalFileViewModel.setIsPatientMedicalReportsLoading(true); medicalFileViewModel.onMedicalReportTabChange(0); diff --git a/lib/presentation/medical_report/widgets/patient_medical_report_card.dart b/lib/presentation/medical_report/widgets/patient_medical_report_card.dart index 413858d..282a2d6 100644 --- a/lib/presentation/medical_report/widgets/patient_medical_report_card.dart +++ b/lib/presentation/medical_report/widgets/patient_medical_report_card.dart @@ -144,7 +144,7 @@ class PatientMedicalReportCard extends StatelessWidget { } catch (ex) { showCommonBottomSheetWithoutHeight( context, - child: Utils.getErrorWidget(loadingText: "Cannot open file".needTranslation), + child: Utils.getErrorWidget(loadingText: "Cannot open file"), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, diff --git a/lib/presentation/monthly_report/monthly_report.dart b/lib/presentation/monthly_report/monthly_report.dart index 1776510..474863b 100644 --- a/lib/presentation/monthly_report/monthly_report.dart +++ b/lib/presentation/monthly_report/monthly_report.dart @@ -95,10 +95,7 @@ class MonthlyReport extends StatelessWidget { Utils.buildSvgWithAssets(icon: AppAssets.prescription_remarks_icon, width: 18.w, height: 18.h), SizedBox(width: 9.h), Expanded( - child: - "This monthly health summary report reflects the health indicators and analysis results of the latest visits. Please note that this will be sent automatically from the system and it’s not considered as a official report so no medical decision should be taken based on it" - .needTranslation - .toText10(weight: FontWeight.w500, color: AppColors.greyTextColorLight), + child: LocaleKeys.monthlyHealthSummaryReportDisclaimer.tr(context: context).toText10(weight: FontWeight.w500, color: AppColors.greyTextColorLight), ), ], ), @@ -146,7 +143,7 @@ class MonthlyReport extends StatelessWidget { CustomButton( text: LocaleKeys.save.tr(), onPressed: () async { - LoaderBottomSheet.showLoader(loadingText: "Updating Monthly Report Status...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.updatingMonthlyReportStatus.tr(context: context)); await monthlyReportVM.updatePatientHealthSummaryReport( rSummaryReport: monthlyReportVM.isHealthSummaryEnabled, onSuccess: (response) async { @@ -157,7 +154,7 @@ class MonthlyReport extends StatelessWidget { ); showCommonBottomSheetWithoutHeight( context, - child: Utils.getSuccessWidget(loadingText: "Monthly Report Status Updated Successfully".needTranslation), + child: Utils.getSuccessWidget(loadingText: LocaleKeys.monthlyReportStatusUpdatedSuccessfully.tr(context: context)), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, diff --git a/lib/presentation/monthly_reports/monthly_reports_page.dart b/lib/presentation/monthly_reports/monthly_reports_page.dart deleted file mode 100644 index d1a4d0c..0000000 --- a/lib/presentation/monthly_reports/monthly_reports_page.dart +++ /dev/null @@ -1,310 +0,0 @@ -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:hmg_patient_app_new/core/app_export.dart'; -import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; -import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; -import 'package:hmg_patient_app_new/features/monthly_reports/monthly_reports_view_model.dart'; -import 'package:hmg_patient_app_new/presentation/monthly_reports/user_agreement_page.dart'; -import 'package:provider/provider.dart'; - -import '../../generated/locale_keys.g.dart'; -import '../../theme/colors.dart'; -import '../../widgets/appbar/app_bar_widget.dart'; -import '../../widgets/input_widget.dart'; -import '../../widgets/loader/bottomsheet_loader.dart'; - -class MonthlyReportsPage extends StatefulWidget { - const MonthlyReportsPage({super.key}); - - @override - State createState() => _MonthlyReportsPageState(); -} - -class _MonthlyReportsPageState extends State { - bool isHealthSummaryEnabled = false; - bool isTermsAccepted = false; - - final TextEditingController emailController = TextEditingController(); - - @override - void dispose() { - emailController.dispose(); - super.dispose(); - } - - void _showError(String message) { - ScaffoldMessenger.of(context).hideCurrentSnackBar(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(message), - behavior: SnackBarBehavior.floating, - ), - ); - } - - void _showSuccessSnackBar() { - ScaffoldMessenger.of(context).hideCurrentSnackBar(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - "Successfully updated".needTranslation, - style: const TextStyle( - color: AppColors.whiteColor, - fontWeight: FontWeight.w600, - ), - ), - behavior: SnackBarBehavior.floating, - backgroundColor: AppColors.textGreenColor, - duration: const Duration(seconds: 2), - ), - ); - } - - Future _onSavePressed() async { - if (!isTermsAccepted) { - _showError("Please accept the terms and conditions".needTranslation); - return; - } - - final email = emailController.text.trim(); - if (email.isEmpty) { - _showError("Please enter your email".needTranslation); - return; - } - - final vm = context.read(); - - // LoaderBottomSheet.showLoader(); - final ok = await vm.saveMonthlyReport(email: email); - // LoaderBottomSheet.hideLoader(); - - if (ok) { - setState(() => isHealthSummaryEnabled = true); - _showSuccessSnackBar(); - } else { - // _showError("Failed to update".needTranslation); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.scaffoldBgColor, - appBar: CustomAppBar( - onBackPressed: () => Navigator.of(context).pop(), - onLanguageChanged: (_) {}, - hideLogoAndLang: true, - ), - body: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Monthly Reports".needTranslation, - style: TextStyle( - color: AppColors.textColor, - fontSize: 27.f, - fontWeight: FontWeight.w600, - ), - ), - SizedBox(height: 16.h), - - Container( - padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h), - height: 54.h, - alignment: Alignment.center, - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: (12.r), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Patient Health Summary Report".needTranslation, - style: TextStyle( - color: AppColors.textColor, - fontSize: 14.f, - fontWeight: FontWeight.w600, - ), - ), - _buildToggle(), - ], - ), - ), - - SizedBox(height: 16.h), - - TextInputWidget( - controller: emailController, - labelText: "Eamil*".needTranslation, - hintText: "email@email.com", - isEnable: true, - prefix: null, - isAllowRadius: true, - isBorderAllowed: false, - isAllowLeadingIcon: true, - autoFocus: true, - keyboardType: TextInputType.emailAddress, - padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h), - onChange: (value) { - setState(() {}); - }, - ).paddingOnly(top: 8.h, bottom: 8.h), - - Row( - children: [ - Text( - "To View The Terms and Conditions".needTranslation, - style: TextStyle( - color: AppColors.textColor, - fontSize: 14.f, - fontWeight: FontWeight.w600, - ), - ), - InkWell( - child: Text( - "Click here".needTranslation, - style: TextStyle( - color: AppColors.primaryRedColor, - fontSize: 14.f, - fontWeight: FontWeight.w600, - ), - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (_) => const UserAgreementPage(), - ), - ); - }, - ), - ], - ), - - SizedBox(height: 12.h), - - GestureDetector( - onTap: () => setState(() => isTermsAccepted = !isTermsAccepted), - child: Row( - children: [ - AnimatedContainer( - duration: const Duration(milliseconds: 200), - height: 24.h, - width: 24.h, - decoration: BoxDecoration( - color: isTermsAccepted - ? AppColors.textGreenColor - : Colors.transparent, - borderRadius: BorderRadius.circular(6), - border: Border.all( - color: isTermsAccepted - ? AppColors.lightGreenColor - : AppColors.greyColor, - width: 2.h, - ), - ), - child: isTermsAccepted - ? Icon(Icons.check, size: 16.f, color: AppColors.whiteColor,) - : null, - ), - SizedBox(width: 12.h), - Text( - "I agree to the terms and conditions".needTranslation, - style: context.dynamicTextStyle( - fontSize: 12.f, - fontWeight: FontWeight.w500, - color: AppColors.textColor, - ), - ), - ], - ), - ), - - SizedBox(height: 12.h), - - Text( - "This monthly Health Summary Report reflects the health indicators and analysis results of the latest visits. Please note that this will be sent automatically from the system and it's not considered as an official report so no medical decisions should be taken based on it" - .needTranslation, - style: TextStyle( - color: AppColors.textColor, - fontSize: 10.f, - fontWeight: FontWeight.w600, - ), - ), - - SizedBox(height: 12.h), - - Image.asset('assets/images/jpg/report.jpg'), - - SizedBox(height: 16.h), - - Row( - children: [ - Expanded( - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: AppColors.successColor, - foregroundColor: AppColors.whiteColor, - elevation: 0, - padding: const EdgeInsets.symmetric(vertical: 14), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - ), - onPressed: _onSavePressed, - child: Text( - LocaleKeys.save.tr(), - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 16.f, - ), - ), - ), - ), - ], - ), - ], - ), - ).paddingAll(16), - ); - } - - Widget _buildToggle() { - final value = isHealthSummaryEnabled; - - return AbsorbPointer( - absorbing: true, - child: AnimatedContainer( - duration: const Duration(milliseconds: 200), - width: 50.h, - height: 28.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), - color: value - ? AppColors.lightGreenColor - : AppColors.greyColor.withOpacity(0.3), - ), - child: AnimatedAlign( - duration: const Duration(milliseconds: 200), - alignment: value ? Alignment.centerRight : Alignment.centerLeft, - child: Padding( - padding: const EdgeInsets.all(3), - child: Container( - width: 22.h, - height: 22.h, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: value - ? AppColors.textGreenColor - : AppColors.greyTextColor, - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/presentation/monthly_reports/user_agreement_page.dart b/lib/presentation/monthly_reports/user_agreement_page.dart deleted file mode 100644 index 73ea564..0000000 --- a/lib/presentation/monthly_reports/user_agreement_page.dart +++ /dev/null @@ -1,117 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; -import 'package:hmg_patient_app_new/features/monthly_reports/terms_conditions_view_model.dart'; -import 'package:provider/provider.dart'; -import 'package:webview_flutter/webview_flutter.dart'; - -import '../../theme/colors.dart'; -import '../../widgets/appbar/app_bar_widget.dart'; - -class UserAgreementPage extends StatefulWidget { - const UserAgreementPage({super.key}); - - @override - State createState() => _UserAgreementPageState(); -} - -class _UserAgreementPageState extends State { - late final WebViewController _webViewController; - bool _isLoading = true; - String? _errorMessage; - - @override - void initState() { - super.initState(); - - _webViewController = WebViewController() - ..setJavaScriptMode(JavaScriptMode.unrestricted) - ..setBackgroundColor(const Color(0x00000000)) - ..setNavigationDelegate( - NavigationDelegate( - onPageStarted: (_) { - setState(() { - _isLoading = true; - }); - }, - onPageFinished: (_) { - setState(() { - _isLoading = false; - }); - }, - onWebResourceError: (error) { - }, - ), - ); - - WidgetsBinding.instance.addPostFrameCallback((_) { - final vm = - Provider.of(context, listen: false); - - vm.getTermsConditions( - onSuccess: () { - final htmlString = vm.termsConditionsHtml ?? ''; - - if (htmlString.isNotEmpty) { - setState(() { - _errorMessage = null; - _isLoading = true; - }); - _webViewController.loadHtmlString(htmlString); - } else { - setState(() { - _isLoading = false; - _errorMessage = 'لا توجد شروط متاحة حالياً'.needTranslation; - }); - } - }, - onError: (msg) { - setState(() { - _isLoading = false; - _errorMessage = msg; - }); - }, - ); - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.scaffoldBgColor, - appBar: CustomAppBar( - onBackPressed: () => Navigator.of(context).pop(), - onLanguageChanged: (_) {}, - hideLogoAndLang: true, - ), - body: Stack( - children: [ - WebViewWidget(controller: _webViewController), - - if (_errorMessage != null) - Center( - child: Container( - margin: const EdgeInsets.all(16), - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: AppColors.whiteColor, - borderRadius: BorderRadius.circular(8), - ), - child: Text( - _errorMessage!, - textAlign: TextAlign.center, - style: TextStyle( - color: AppColors.primaryRedColor, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - if (_isLoading) - const Center( - child: CircularProgressIndicator(), - ), - ], - ), - ); - } -} diff --git a/lib/presentation/my_family/my_family.dart b/lib/presentation/my_family/my_family.dart index 07f1a4f..b16c587 100644 --- a/lib/presentation/my_family/my_family.dart +++ b/lib/presentation/my_family/my_family.dart @@ -50,7 +50,7 @@ class _FamilyMedicalScreenState extends State { AppState appState = getIt.get(); return CollapsingListView( - title: "Medical Files".needTranslation, + title: LocaleKeys.medicalFiles.tr(context: context), bottomChild: appState.getAuthenticatedUser()!.isParentUser! ? Container( decoration: RoundedRectangleBorder().toSmoothCornerDecoration( @@ -59,13 +59,13 @@ class _FamilyMedicalScreenState extends State { ), padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 20.h), child: CustomButton( - text: "Add a new family member".needTranslation, + text: LocaleKeys.addANewFamilyMember.tr(context: context), onPressed: () { DialogService dialogService = getIt.get(); medicalVM!.clearAuthValues(); dialogService.showAddFamilyFileSheet( - label: "Add Family Member".needTranslation, - message: "Please fill the below field to add a new family member to your profile".needTranslation, + label: LocaleKeys.addFamilyMember.tr(context: context), + message: LocaleKeys.pleaseFillBelowFieldToAddNewFamilyMember.tr(context: context), onVerificationPress: () { medicalVM!.addFamilyFile(otpTypeEnum: OTPTypeEnum.sms); }); diff --git a/lib/presentation/my_family/widget/family_cards.dart b/lib/presentation/my_family/widget/family_cards.dart index 3621cc3..675da18 100644 --- a/lib/presentation/my_family/widget/family_cards.dart +++ b/lib/presentation/my_family/widget/family_cards.dart @@ -54,12 +54,10 @@ class _FamilyCardsState extends State { children: [ Utils.buildSvgWithAssets(icon: AppAssets.alertSquare), SizedBox(width: 8.h), - "Who can view my medical file ?" - .needTranslation - .toText14(color: AppColors.textColor, isUnderLine: true, weight: FontWeight.w500) + LocaleKeys.whoCanViewMyMedicalFile.tr(context: context).toText14(color: AppColors.textColor, isUnderLine: true, weight: FontWeight.w500) .onPress(() { dialogService.showFamilyBottomSheetWithoutHWithChild( - label: "Manage Family".needTranslation, + label: LocaleKeys.manageFiles.tr(context: context), message: "", child: manageFamily(), onOkPressed: () {}, @@ -213,7 +211,7 @@ class _FamilyCardsState extends State { onPressed: () { if (canSwitch) widget.onSelect(profile); }, - text: isActive ? "Active".needTranslation : "Switch".needTranslation, + text: isActive ? LocaleKeys.active.tr(context: context) : LocaleKeys.switchLogin.tr(context: context), backgroundColor: isActive || !canSwitch ? Colors.grey.shade200 : AppColors.secondaryLightRedColor, borderColor: isActive || !canSwitch ? Colors.grey.shade200 : AppColors.secondaryLightRedColor, textColor: isActive || !canSwitch ? AppColors.greyTextColor : AppColors.primaryRedColor, @@ -309,7 +307,7 @@ class _FamilyCardsState extends State { height: 30.h, chipType: ChipTypeEnum.alert, backgroundColor: AppColors.lightGrayBGColor, - chipText: "Medical File: ${profile.patientId ?? "N/A".needTranslation}", + chipText: "${LocaleKeys.medicalFile.tr(context: context)}: ${profile.patientId ?? "N/A"}", iconAsset: null, isShowBorder: false, borderRadius: 8.h, @@ -364,26 +362,26 @@ class _FamilyCardsState extends State { switch (status) { case FamilyFileEnum.active: if (isRequestFromMySide) { - return "${status.displayName} your request to be your family member".needTranslation; + return LocaleKeys.acceptedYourRequestToBeYourFamilyMember.tr(namedArgs: {'status': status.displayName}, context: context); } else { - return "can view your file".needTranslation; + return LocaleKeys.canViewYourFile.tr(context: context); } case FamilyFileEnum.pending: if (isRequestFromMySide) { - return "has a request ${status.displayName} to be your family member".needTranslation; + return LocaleKeys.hasARequestPendingToBeYourFamilyMember.tr(namedArgs: {'status': status.displayName}, context: context); } else { - return "wants to add you as their family member".needTranslation; + return LocaleKeys.wantsToAddYouAsTheirFamilyMember.tr(context: context); } case FamilyFileEnum.rejected: if (isRequestFromMySide) { - return "${status.displayName} your request to be your family member".needTranslation; + return LocaleKeys.rejectedYourRequestToBeYourFamilyMember.tr(namedArgs: {'status': status.displayName}, context: context); } else { - return "${status.displayName} your family member request".needTranslation; + return LocaleKeys.rejectedYourFamilyMemberRequest.tr(namedArgs: {'status': status.displayName}, context: context); } case FamilyFileEnum.inactive: - return "Inactive".needTranslation; + return LocaleKeys.inactive.tr(context: context); default: - return "N/A".needTranslation; + return LocaleKeys.notAvailable.tr(context: context); } } } diff --git a/lib/presentation/my_family/widget/my_family_sheet.dart b/lib/presentation/my_family/widget/my_family_sheet.dart index d469ab2..50f1b2a 100644 --- a/lib/presentation/my_family/widget/my_family_sheet.dart +++ b/lib/presentation/my_family/widget/my_family_sheet.dart @@ -1,7 +1,9 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/features/medical_file/models/family_file_response_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/my_family/widget/family_cards.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; @@ -15,8 +17,8 @@ class MyFamilySheet { titleWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - 'Please select a profile'.needTranslation.toText21(isBold: true), - 'switch from the below list of medical file'.needTranslation.toText16(weight: FontWeight.w100, color: AppColors.greyTextColor), + LocaleKeys.selectAProfile.tr(context: context).toText21(isBold: true), + LocaleKeys.switchFamilyFile.tr(context: context).toText16(weight: FontWeight.w100, color: AppColors.greyTextColor), ], ), child: FamilyCards( diff --git a/lib/presentation/my_invoices/my_invoices_details_page.dart b/lib/presentation/my_invoices/my_invoices_details_page.dart index cccd671..a38194f 100644 --- a/lib/presentation/my_invoices/my_invoices_details_page.dart +++ b/lib/presentation/my_invoices/my_invoices_details_page.dart @@ -39,9 +39,9 @@ class _MyInvoicesDetailsPageState extends State { children: [ Expanded( child: CollapsingListView( - title: "Invoice Details".needTranslation, + title: LocaleKeys.invoiceDetails.tr(context: context), sendEmail: () async { - LoaderBottomSheet.showLoader(loadingText: "Sending email, Please wait...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.sendingEmailPleaseWait.tr(context: context)); await myInvoicesViewModel.sendInvoiceEmail( appointmentNo: widget.getInvoiceDetailsResponseModel.appointmentNo!, projectID: widget.getInvoiceDetailsResponseModel.projectID!, @@ -49,7 +49,7 @@ class _MyInvoicesDetailsPageState extends State { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( context, - child: Utils.getSuccessWidget(loadingText: "Email sent successfully.".needTranslation), + child: Utils.getSuccessWidget(loadingText: LocaleKeys.emailSentSuccessfullyMessage.tr(context: context)), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, @@ -223,12 +223,12 @@ class _MyInvoicesDetailsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox(height: 24.h), - "Total Balance".needTranslation.toText18(isBold: true).paddingSymmetrical(24.h, 0.h), + LocaleKeys.totalBalance.tr(context: context).toText18(isBold: true).paddingSymmetrical(24.h, 0.h), SizedBox(height: 17.h), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Amount before tax".needTranslation.toText14(isBold: true), + LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true), Utils.getPaymentAmountWithSymbol(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalShare.toString().toText16(isBold: true), AppColors.blackColor, 13, isSaudiCurrency: true), ], @@ -236,7 +236,7 @@ class _MyInvoicesDetailsPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "VAT 15%".needTranslation.toText14(isBold: true, color: AppColors.greyTextColor), + LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor), Utils.getPaymentAmountWithSymbol( widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalVATAmount!.toString().toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13, isSaudiCurrency: true), @@ -246,7 +246,7 @@ class _MyInvoicesDetailsPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Discount".needTranslation.toText14(isBold: true), + LocaleKeys.discount.tr(context: context).toText14(isBold: true), Utils.getPaymentAmountWithSymbol(widget.getInvoiceDetailsResponseModel.listConsultation!.first.discountAmount!.toString().toText14(isBold: true, color: AppColors.primaryRedColor), AppColors.primaryRedColor, 13, isSaudiCurrency: true), @@ -255,7 +255,7 @@ class _MyInvoicesDetailsPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Paid".needTranslation.toText14(isBold: true), + LocaleKeys.paid.tr(context: context).toText14(isBold: true), Utils.getPaymentAmountWithSymbol( widget.getInvoiceDetailsResponseModel.listConsultation!.first.grandTotal!.toString().toText14(isBold: true, color: AppColors.textColor), AppColors.textColor, 13, isSaudiCurrency: true), diff --git a/lib/presentation/my_invoices/my_invoices_list.dart b/lib/presentation/my_invoices/my_invoices_list.dart index ef1a9c2..9f969e8 100644 --- a/lib/presentation/my_invoices/my_invoices_list.dart +++ b/lib/presentation/my_invoices/my_invoices_list.dart @@ -77,7 +77,7 @@ class _MyInvoicesListState extends State { getInvoicesListResponseModel: myInvoicesVM.allInvoicesList[index], onTap: () async { myInvoicesVM.setInvoiceDetailLoading(); - LoaderBottomSheet.showLoader(loadingText: "Fetching invoice details, Please wait...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingInvoiceDetails.tr(context: context)); await myInvoicesVM.getInvoiceDetails( appointmentNo: myInvoicesVM.allInvoicesList[index].appointmentNo!, invoiceNo: myInvoicesVM.allInvoicesList[index].invoiceNo!, diff --git a/lib/presentation/my_invoices/widgets/invoice_list_card.dart b/lib/presentation/my_invoices/widgets/invoice_list_card.dart index 27ca79a..4a328c5 100644 --- a/lib/presentation/my_invoices/widgets/invoice_list_card.dart +++ b/lib/presentation/my_invoices/widgets/invoice_list_card.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; @@ -41,11 +42,11 @@ class InvoiceListCard extends StatelessWidget { AppCustomChipWidget( icon: AppAssets.walkin_appointment_icon, iconColor: AppColors.textColor, - labelText: 'Walk In'.needTranslation, + labelText: LocaleKeys.walkin.tr(context: context), textColor: AppColors.textColor, ), AppCustomChipWidget( - labelText: 'OutPatient'.needTranslation, + labelText: LocaleKeys.outPatient.tr(context: context), backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.1), textColor: AppColors.primaryRedColor, ), @@ -127,7 +128,7 @@ class InvoiceListCard extends StatelessWidget { ), SizedBox(height: 16.h), CustomButton( - text: "View invoice details".needTranslation, + text: LocaleKeys.viewInvoiceDetails.tr(context: context), onPressed: () { if (onTap != null) { onTap!(); diff --git a/lib/presentation/notifications/notifications_list_page.dart b/lib/presentation/notifications/notifications_list_page.dart index 650753c..c5f5d12 100644 --- a/lib/presentation/notifications/notifications_list_page.dart +++ b/lib/presentation/notifications/notifications_list_page.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; @@ -8,6 +9,7 @@ import 'package:hmg_patient_app_new/extensions/int_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/notifications/notifications_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart'; import 'package:hmg_patient_app_new/presentation/notifications/notification_details_page.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; @@ -21,7 +23,7 @@ class NotificationsListPage extends StatelessWidget { @override Widget build(BuildContext context) { return CollapsingListView( - title: "Notifications".needTranslation, + title: LocaleKeys.notifications.tr(context: context), child: SingleChildScrollView( child: Consumer(builder: (context, notificationsVM, child) { return Container( diff --git a/lib/presentation/onboarding/onboarding_screen.dart b/lib/presentation/onboarding/onboarding_screen.dart index a40a27b..bfcdc96 100644 --- a/lib/presentation/onboarding/onboarding_screen.dart +++ b/lib/presentation/onboarding/onboarding_screen.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; @@ -6,6 +7,7 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; @@ -67,13 +69,13 @@ class _OnboardingScreenState extends State { children: [ onboardingView( AppAnimations.onboarding_1, - "Booking appointment has never been easy".needTranslation, - "In few clicks find yourself having consultation with the doctor of your choice.".needTranslation, + LocaleKeys.onboardingHeading1.tr(context: context), + LocaleKeys.onboardingBody1.tr(context: context), ), onboardingView( AppAnimations.onboarding_2, - "Access the medical history on finger tips".needTranslation, - "Keep track on your medical history including labs, prescription, insurance, etc".needTranslation, + LocaleKeys.onboardingHeading2.tr(context: context), + LocaleKeys.onboardingBody2.tr(context: context), ), ], onPageChanged: (int index) { @@ -107,7 +109,7 @@ class _OnboardingScreenState extends State { transitionBuilder: (child, anim) => FadeTransition(opacity: anim, child: child), child: selectedIndex == 0 ? CustomButton( - text: "Skip".needTranslation, + text: LocaleKeys.skip.tr(context: context), onPressed: () => goToHomePage(), width: 86.w, height: 56.h, @@ -136,13 +138,13 @@ class _OnboardingScreenState extends State { iconSize: 32.w, width: 86.w, height: 56.h, - text: "".needTranslation, + text: "", backgroundColor: Colors.transparent, onPressed: () { pageController.animateToPage(1, duration: Duration(milliseconds: 400), curve: Curves.easeInOut); }) : CustomButton( - text: "Get Started".needTranslation, + text: LocaleKeys.getStarted.tr(context: context), fontWeight: FontWeight.w500, fontSize: 16.f, height: 56.h, diff --git a/lib/presentation/parking/paking_page.dart b/lib/presentation/parking/paking_page.dart index d9cc1d8..db451b2 100644 --- a/lib/presentation/parking/paking_page.dart +++ b/lib/presentation/parking/paking_page.dart @@ -1,9 +1,10 @@ - +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/parking/parking_slot.dart'; import 'package:provider/provider.dart'; @@ -85,7 +86,7 @@ class _ParkingPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Parking".needTranslation, + LocaleKeys.parking.tr(context: context), style: TextStyle( color: AppColors.textColor, fontSize: 27.f, @@ -100,22 +101,7 @@ class _ParkingPageState extends State { hasShadow: true, ), child: Padding( - padding: EdgeInsets.all(16.h), - child: Text( - "Dr. Sulaiman Al Habib hospital are conduction a test for the emerging corona" - " virus and issuing travel certificates 24/7 in a short time and with high accuracy." - " Those wishing to benefit from this service can visit one of Dr. Sulaiman Al Habib branches " - "to conduct a corona test within few minutes. Dr. Sulaiman Al Habib hospital are conduction" - " a test for the emerging corona virus and issuing travel certificates 24/7 in a short time and with high accuracy. " - "Those wishing to benefit from this service can visit one of Dr. Sulaiman Al Habib branches to conduct a corona test within few minutes.", - style: TextStyle( - color: AppColors.textColor, - fontSize: 12, - height: 1.4, - fontWeight: FontWeight.w500, - ), - ), - ), + padding: EdgeInsets.all(16.h), child: LocaleKeys.parkingDescription.tr(context: context).toText12(fontWeight: FontWeight.w500, color: AppColors.textColor)), ).paddingOnly(top: 16, bottom: 16), ], ), @@ -131,18 +117,16 @@ class _ParkingPageState extends State { ), child: Padding( padding: EdgeInsets.all(24.h), - child: SizedBox( - width: double.infinity, - height: 56, - child: CustomButton( - text: "Read Barcodes".needTranslation, - onPressed: () => _readQR(context), // always non-null - isDisabled: vm.isLoading, - backgroundColor: AppColors.primaryRedColor, - borderColor: AppColors.primaryRedColor, - fontSize: 18, - fontWeight: FontWeight.bold, - ), + child: CustomButton( + text: LocaleKeys.scanQRCode.tr(context: context), + onPressed: () => _readQR(context), + // always non-null + isDisabled: vm.isLoading, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + fontSize: 18.f, + height: 56.h, + fontWeight: FontWeight.bold, ), ), ), diff --git a/lib/presentation/parking/parking_slot.dart b/lib/presentation/parking/parking_slot.dart index 0eb3718..52ab181 100644 --- a/lib/presentation/parking/parking_slot.dart +++ b/lib/presentation/parking/parking_slot.dart @@ -1,10 +1,12 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/qr_parking/models/qr_parking_response_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import '../../features/qr_parking/qr_parking_view_model.dart'; import '../../theme/colors.dart'; import '../../widgets/appbar/app_bar_widget.dart'; @@ -157,7 +159,7 @@ class _ParkingSlotState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Parking Slot Details".needTranslation, + LocaleKeys.parkingSlotDetails.tr(context: context), style: TextStyle( fontSize: 16.f, fontWeight: FontWeight.w600, @@ -170,16 +172,16 @@ class _ParkingSlotState extends State { runSpacing: 4, children: [ AppCustomChipWidget( - labelText: "Slot: ${widget.model.qRParkingCode ?? '-'}".needTranslation, + labelText: LocaleKeys.slotNumber.tr(namedArgs: {'code': widget.model.qRParkingCode ?? '-'}, context: context), ), AppCustomChipWidget( - labelText: "Basement: ${widget.model.floorDescription ?? '-'}".needTranslation, + labelText: LocaleKeys.basement.tr(namedArgs: {'description': widget.model.floorDescription ?? '-'}, context: context), ), AppCustomChipWidget( - labelText: "Date: ${_formatPrettyDate(widget.model.createdOn)}".needTranslation, + labelText: LocaleKeys.parkingDate.tr(namedArgs: {'date': _formatPrettyDate(widget.model.createdOn)}, context: context), ), AppCustomChipWidget( - labelText: "Parked Since: ${_formatPrettyTime(widget.model.createdOn)}".needTranslation, + labelText: LocaleKeys.parkedSince.tr(namedArgs: {'time': _formatPrettyTime(widget.model.createdOn)}, context: context), ), ], ), @@ -193,7 +195,7 @@ class _ParkingSlotState extends State { width: double.infinity, height: 48.h, child: CustomButton( - text: "Get Direction".needTranslation, + text: LocaleKeys.getDirections.tr(context: context), onPressed: _openDirection, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, @@ -210,14 +212,14 @@ class _ParkingSlotState extends State { width: double.infinity, height: 48.h, child: CustomButton( - text: "Reset Direction".needTranslation, + text: LocaleKeys.resetDirection.tr(context: context), onPressed: _resetDirection, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, textColor: AppColors.whiteColor, - fontSize: 18, + fontSize: 18.f, fontWeight: FontWeight.bold, - borderRadius: 10, + borderRadius: 10.r, ), ), ], diff --git a/lib/presentation/prescriptions/prescription_delivery_order_summary_page.dart b/lib/presentation/prescriptions/prescription_delivery_order_summary_page.dart index 0bedbe2..5a34034 100644 --- a/lib/presentation/prescriptions/prescription_delivery_order_summary_page.dart +++ b/lib/presentation/prescriptions/prescription_delivery_order_summary_page.dart @@ -118,7 +118,7 @@ class PrescriptionDeliveryOrderSummaryPage extends StatelessWidget { child: CustomButton( text: LocaleKeys.submit.tr(context: context), onPressed: () async { - LoaderBottomSheet.showLoader(loadingText: "Submitting your request..."); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context)); await prescriptionsViewModel.submitPrescriptionDeliveryRequest( latitude: prescriptionsViewModel.locationGeocodeResponse.results.first.geometry.location.lat.toString(), longitude: prescriptionsViewModel.locationGeocodeResponse.results.first.geometry.location.lng.toString(), @@ -129,7 +129,7 @@ class PrescriptionDeliveryOrderSummaryPage extends StatelessWidget { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( context, - child: Utils.getSuccessWidget(loadingText: "Request sent successfully.".needTranslation), + child: Utils.getSuccessWidget(loadingText: LocaleKeys.requestSubmittedSuccessfully.tr(context: context)), callBackFunc: () { Navigator.of(context).pop(); }, diff --git a/lib/presentation/prescriptions/prescription_delivery_orders_list_page.dart b/lib/presentation/prescriptions/prescription_delivery_orders_list_page.dart index e2ce865..7760fd2 100644 --- a/lib/presentation/prescriptions/prescription_delivery_orders_list_page.dart +++ b/lib/presentation/prescriptions/prescription_delivery_orders_list_page.dart @@ -88,7 +88,7 @@ class PrescriptionDeliveryOrdersListPage extends StatelessWidget { ), ), ) - : Utils.getNoDataWidget(context, noDataText: "You don't have any prescription orders yet.".needTranslation); + : Utils.getNoDataWidget(context, noDataText: LocaleKeys.noPrescriptionOrdersYet.tr(context: context)); }, ).paddingSymmetrical(24.h, 0.h), ], diff --git a/lib/presentation/prescriptions/prescription_detail_page.dart b/lib/presentation/prescriptions/prescription_detail_page.dart index 1216c61..9b1ae6d 100644 --- a/lib/presentation/prescriptions/prescription_detail_page.dart +++ b/lib/presentation/prescriptions/prescription_detail_page.dart @@ -62,7 +62,7 @@ class _PrescriptionDetailPageState extends State { child: CollapsingListView( title: LocaleKeys.prescriptions.tr(context: context), instructions: () async { - LoaderBottomSheet.showLoader(loadingText: "Fetching prescription PDF, Please wait...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingPrescriptionPDFPleaseWait.tr(context: context)); await prescriptionsViewModel.getPrescriptionInstructionsPDF(widget.prescriptionsResponseModel, onSuccess: (val) { LoaderBottomSheet.hideLoader(); if (prescriptionsViewModel.prescriptionInstructionsPDFLink.isNotEmpty) { @@ -71,7 +71,7 @@ class _PrescriptionDetailPageState extends State { } else { showCommonBottomSheetWithoutHeight( context, - child: Utils.getErrorWidget(loadingText: "Unable to fetch PDF".needTranslation), + child: Utils.getErrorWidget(loadingText: "Unable to fetch PDF"), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, @@ -136,7 +136,7 @@ class _PrescriptionDetailPageState extends State { AppCustomChipWidget( icon: AppAssets.rating_icon, iconColor: AppColors.ratingColorYellow, - labelText: "Rating: ${widget.prescriptionsResponseModel.decimalDoctorRate}".needTranslation, + labelText: LocaleKeys.ratingValue.tr(namedArgs: {'rating': widget.prescriptionsResponseModel.decimalDoctorRate.toString()}, context: context), ), AppCustomChipWidget( labelText: widget.prescriptionsResponseModel.name!, @@ -145,9 +145,9 @@ class _PrescriptionDetailPageState extends State { ), SizedBox(height: 16.h), CustomButton( - text: "Download Prescription".needTranslation, + text: LocaleKeys.downloadPrescription.tr(context: context), onPressed: () async { - LoaderBottomSheet.showLoader(loadingText: "Fetching prescription PDF, Please wait...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingPrescriptionPDFPleaseWait.tr(context: context)); await prescriptionVM.getPrescriptionPDFBase64(widget.prescriptionsResponseModel).then((val) async { LoaderBottomSheet.hideLoader(); if (prescriptionVM.prescriptionPDFBase64Data.isNotEmpty) { @@ -157,7 +157,7 @@ class _PrescriptionDetailPageState extends State { } catch (ex) { showCommonBottomSheetWithoutHeight( context, - child: Utils.getErrorWidget(loadingText: "Cannot open file".needTranslation), + child: Utils.getErrorWidget(loadingText: "Cannot open file"), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, @@ -221,7 +221,7 @@ class _PrescriptionDetailPageState extends State { : LocaleKeys.prescriptionDeliveryError.tr(context: context), onPressed: () async { if (widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported!) { - LoaderBottomSheet.showLoader(loadingText: "Fetching prescription details...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingPrescriptionDetails.tr(context: context)); await prescriptionsViewModel.getPrescriptionDetails(widget.prescriptionsResponseModel, onSuccess: (val) { LoaderBottomSheet.hideLoader(); prescriptionsViewModel.initiatePrescriptionDelivery(); diff --git a/lib/presentation/prescriptions/prescription_reminder_view.dart b/lib/presentation/prescriptions/prescription_reminder_view.dart index 2f1154f..aab587d 100644 --- a/lib/presentation/prescriptions/prescription_reminder_view.dart +++ b/lib/presentation/prescriptions/prescription_reminder_view.dart @@ -54,7 +54,7 @@ class _PrescriptionReminderViewState extends State { ), child: RadioListTile( title: Text( - "${_options[index]} minutes before".needTranslation, + "${_options[index]} ${LocaleKeys.minute.tr(context: context)}", style: TextStyle( fontSize: 16.h, fontWeight: FontWeight.w500, diff --git a/lib/presentation/prescriptions/prescriptions_list_page.dart b/lib/presentation/prescriptions/prescriptions_list_page.dart index 8b60159..e2a862b 100644 --- a/lib/presentation/prescriptions/prescriptions_list_page.dart +++ b/lib/presentation/prescriptions/prescriptions_list_page.dart @@ -247,7 +247,7 @@ class _PrescriptionsListPageState extends State { : LocaleKeys.prescriptionDeliveryError.tr(context: context), onPressed: () async { if (prescription.isHomeMedicineDeliverySupported!) { - LoaderBottomSheet.showLoader(loadingText: "Fetching prescription details...".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingPrescriptionDetails.tr(context: context)); await prescriptionsViewModel.getPrescriptionDetails(prescriptionsViewModel.patientPrescriptionOrders[index], onSuccess: (val) { LoaderBottomSheet.hideLoader(); @@ -322,7 +322,7 @@ class _PrescriptionsListPageState extends State { ), ), ) - : Utils.getNoDataWidget(context, noDataText: "You don't have any prescriptions yet.".needTranslation); + : Utils.getNoDataWidget(context, noDataText: LocaleKeys.youDontHaveAnyPrescriptionsYet.tr(context: context)); }, ).paddingSymmetrical(24.h, 0.h), ], diff --git a/lib/presentation/profile_settings/profile_settings.dart b/lib/presentation/profile_settings/profile_settings.dart index 1c16439..0bf7058 100644 --- a/lib/presentation/profile_settings/profile_settings.dart +++ b/lib/presentation/profile_settings/profile_settings.dart @@ -83,7 +83,7 @@ class ProfileSettingsState extends State { @override Widget build(BuildContext context) { return CollapsingListView( - title: "Profile & Settings".needTranslation, + title: LocaleKeys.profileAndSettings.tr(context: context), logout: () {}, isClose: true, child: SingleChildScrollView( @@ -114,8 +114,8 @@ class ProfileSettingsState extends State { onAddFamilyMemberPress: () { DialogService dialogService = getIt.get(); dialogService.showAddFamilyFileSheet( - label: "Add Family Member".needTranslation, - message: "Please fill the below field to add a new family member to your profile".needTranslation, + label: LocaleKeys.addFamilyMember.tr(), + message: LocaleKeys.pleaseFillBelowFieldToAddNewFamilyMember.tr(), onVerificationPress: () { medicalVm.addFamilyFile(otpTypeEnum: OTPTypeEnum.sms); }); @@ -149,7 +149,7 @@ class ProfileSettingsState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h), - "Habib Wallet".needTranslation.toText16(weight: FontWeight.w600, maxlines: 2).expanded, + LocaleKeys.habibWallet.tr(context: context).toText16(weight: FontWeight.w600, maxlines: 2).expanded, Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), ], ), @@ -165,7 +165,7 @@ class ProfileSettingsState extends State { iconSize: 22.w, iconColor: AppColors.infoColor, textColor: AppColors.infoColor, - text: "Recharge".needTranslation, + text: LocaleKeys.recharge.tr(context: context), borderWidth: 0.w, fontWeight: FontWeight.w500, borderColor: Colors.transparent, @@ -183,9 +183,7 @@ class ProfileSettingsState extends State { ), ], ), - "Quick Actions" - .needTranslation - .toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1) + LocaleKeys.quickActions.tr(context: context).toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1) .paddingOnly(left: 24.w, right: 24.w), Container( margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h), @@ -195,17 +193,15 @@ class ProfileSettingsState extends State { children: [ actionItem(AppAssets.language_change, LocaleKeys.language.tr(context: context), () { showCommonBottomSheetWithoutHeight(context, title: LocaleKeys.language.tr(context: context), child: AppLanguageChange(), callBackFunc: () {}, isFullScreen: false); - }, trailingLabel: Utils.appState.isArabic() ? "العربية".needTranslation : "English".needTranslation), + }, trailingLabel: Utils.appState.isArabic() ? "العربية" : "English"), 1.divider, - actionItem(AppAssets.bell, "Notifications Settings".needTranslation, () {}), + actionItem(AppAssets.bell, LocaleKeys.notificationsSettings.tr(context: context), () {}), 1.divider, - actionItem(AppAssets.touch_face_id, "Touch ID / Face ID Services".needTranslation, () {}, switchValue: true), + actionItem(AppAssets.touch_face_id, LocaleKeys.touchIDFaceIDServices.tr(), () {}, switchValue: true), ], ), ), - "Personal Information" - .needTranslation - .toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1) + LocaleKeys.personalInformation.tr().toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1) .paddingOnly(left: 24.w, right: 24.w), Container( margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h), @@ -213,7 +209,7 @@ class ProfileSettingsState extends State { decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true), child: Column( children: [ - actionItem(AppAssets.email_transparent, "Update Email Address".needTranslation, () {}), + actionItem(AppAssets.email_transparent, LocaleKeys.updateEmailAddress.tr(), () {}), // 1.divider, // actionItem(AppAssets.smart_phone_fill, "Phone Number".needTranslation, () {}), // 1.divider, @@ -223,9 +219,7 @@ class ProfileSettingsState extends State { ], ), ), - "Help & Support" - .needTranslation - .toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1) + LocaleKeys.helpAndSupport.tr().toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1) .paddingOnly(left: 24.w, right: 24.w), Container( margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h), @@ -237,9 +231,9 @@ class ProfileSettingsState extends State { launchUrl(Uri.parse("tel://" + "+966 11 525 9999")); }, trailingLabel: "011 525 9999"), 1.divider, - actionItem(AppAssets.permission, "Permissions".needTranslation, () {}, trailingLabel: "Location, Camera"), + actionItem(AppAssets.permission, LocaleKeys.permissions.tr(), () {}, trailingLabel: "Location, Camera"), 1.divider, - actionItem(AppAssets.rate, "Rate Our App".needTranslation, () { + actionItem(AppAssets.rate, LocaleKeys.rateApp.tr(), () { if (Platform.isAndroid) { Utils.openWebView( url: 'https://play.google.com/store/apps/details?id=com.ejada.hmg', @@ -251,13 +245,13 @@ class ProfileSettingsState extends State { } }, isExternalLink: true), 1.divider, - actionItem(AppAssets.privacy_terms, "Privacy Policy".needTranslation, () { + actionItem(AppAssets.privacy_terms, LocaleKeys.privacyPolicy.tr(), () { Utils.openWebView( url: 'https://hmg.com/en/Pages/Privacy.aspx', ); }, isExternalLink: true), 1.divider, - actionItem(AppAssets.privacy_terms, "Terms & Conditions".needTranslation, () { + actionItem(AppAssets.privacy_terms, LocaleKeys.termsConditoins.tr(context: context), () { Utils.openWebView( url: 'https://hmg.com/en/Pages/Terms.aspx', ); @@ -268,7 +262,7 @@ class ProfileSettingsState extends State { CustomButton( height: 56.h, icon: AppAssets.minus, - text: "Deactivate account".needTranslation, + text: LocaleKeys.deactivateAccount.tr(), onPressed: () {}, ).paddingAll(24.w), ], @@ -363,7 +357,7 @@ class FamilyCardWidget extends StatelessWidget { runSpacing: 4.h, children: [ AppCustomChipWidget( - labelText: "${profile.age} Years Old".needTranslation, + labelText: LocaleKeys.ageYearsOld.tr(namedArgs: {'age': profile.age.toString(), 'yearsOld': LocaleKeys.yearsOld.tr(context: context)}), ), isActive && appState.getAuthenticatedUser()!.bloodGroup != null ? AppCustomChipWidget( @@ -396,17 +390,17 @@ class FamilyCardWidget extends StatelessWidget { if (isLoading) { icon = AppAssets.cancel_circle_icon; - labelText = "Insurance".needTranslation; + labelText = LocaleKeys.insurance.tr(context: context); iconColor = AppColors.primaryRedColor; backgroundColor = AppColors.primaryRedColor; } else if (isExpired) { icon = AppAssets.cancel_circle_icon; - labelText = "Insurance Expired".needTranslation; + labelText = LocaleKeys.insuranceExpired.tr(context: context); iconColor = AppColors.primaryRedColor; backgroundColor = AppColors.primaryRedColor.withValues(alpha: 0.15); } else { icon = AppAssets.insurance_active_icon; - labelText = "Insurance Active".needTranslation; + labelText = LocaleKeys.insuranceActive.tr(context: context); iconColor = AppColors.successColor; backgroundColor = AppColors.successColor.withValues(alpha: 0.15); } @@ -451,7 +445,7 @@ class FamilyCardWidget extends StatelessWidget { return CustomButton( icon: canSwitch ? AppAssets.switch_user : AppAssets.add_family, - text: canSwitch ? "Switch Family File".needTranslation : "Add a new family member".needTranslation, + text: canSwitch ? LocaleKeys.switchFamilyFile.tr() : LocaleKeys.addANewFamilyMember.tr(), onPressed: canSwitch ? () => onFamilySwitchPress(profile) : onAddFamilyMemberPress, backgroundColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor, borderColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor, @@ -467,7 +461,7 @@ class FamilyCardWidget extends StatelessWidget { return CustomButton( icon: AppAssets.switch_user, - text: canSwitchBack ? "Switch Back To Family File".needTranslation : "Switch".needTranslation, + text: canSwitchBack ? LocaleKeys.switchBackFamilyFile.tr() : LocaleKeys.switchLogin.tr(), backgroundColor: canSwitchBack ? AppColors.primaryRedColor : Colors.grey.shade200, borderColor: canSwitchBack ? AppColors.primaryRedColor : Colors.grey.shade200, textColor: canSwitchBack ? AppColors.whiteColor : AppColors.greyTextColor, diff --git a/lib/presentation/profile_settings/widgets/family_card_widget.dart b/lib/presentation/profile_settings/widgets/family_card_widget.dart index eaee4c0..b21c52d 100644 --- a/lib/presentation/profile_settings/widgets/family_card_widget.dart +++ b/lib/presentation/profile_settings/widgets/family_card_widget.dart @@ -73,7 +73,7 @@ class FamilyCardWidget extends StatelessWidget { runSpacing: 4.h, children: [ AppCustomChipWidget( - labelText: "${profile.age} Years Old".needTranslation, + labelText: "${profile.age} ${LocaleKeys.yearsOld.tr(context: context)}", ), isActive && appState.getAuthenticatedUser()!.bloodGroup != null ? AppCustomChipWidget( @@ -106,17 +106,17 @@ class FamilyCardWidget extends StatelessWidget { if (isLoading) { icon = AppAssets.cancel_circle_icon; - labelText = "Insurance".needTranslation; + labelText = LocaleKeys.insurance.tr(context: context); iconColor = AppColors.primaryRedColor; backgroundColor = AppColors.primaryRedColor; } else if (isExpired) { icon = AppAssets.cancel_circle_icon; - labelText = "Insurance Expired".needTranslation; + labelText = LocaleKeys.insuranceExpired.tr(context: context); iconColor = AppColors.primaryRedColor; backgroundColor = AppColors.primaryRedColor.withValues(alpha: 0.15); } else { icon = AppAssets.insurance_active_icon; - labelText = "Insurance Active".needTranslation; + labelText = LocaleKeys.insuranceActive.tr(context: context); iconColor = AppColors.successColor; backgroundColor = AppColors.successColor.withValues(alpha: 0.15); } @@ -161,7 +161,7 @@ class FamilyCardWidget extends StatelessWidget { return CustomButton( icon: canSwitch ? AppAssets.switch_user : AppAssets.add_family, - text: canSwitch ? "Switch Family File".needTranslation : "Add a new family member".needTranslation, + text: canSwitch ? LocaleKeys.switchAccount.tr() : LocaleKeys.addANewFamilyMember.tr(), onPressed: canSwitch ? () => onFamilySwitchPress(profile) : onAddFamilyMemberPress, backgroundColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor, borderColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor, @@ -177,7 +177,7 @@ class FamilyCardWidget extends StatelessWidget { return CustomButton( icon: AppAssets.switch_user, - text: canSwitchBack ? "Switch Back To Family File".needTranslation : "Switch".needTranslation, + text: canSwitchBack ? LocaleKeys.switchBackFamilyFile.tr() : LocaleKeys.switchLogin.tr(), backgroundColor: canSwitchBack ? AppColors.primaryRedColor : Colors.grey.shade200, borderColor: canSwitchBack ? AppColors.primaryRedColor : Colors.grey.shade200, textColor: canSwitchBack ? AppColors.whiteColor : AppColors.greyTextColor, diff --git a/lib/presentation/radiology/radiology_orders_page.dart b/lib/presentation/radiology/radiology_orders_page.dart index fb153ea..e1ec426 100644 --- a/lib/presentation/radiology/radiology_orders_page.dart +++ b/lib/presentation/radiology/radiology_orders_page.dart @@ -179,7 +179,7 @@ class _RadiologyOrdersPageState extends State { } if (model.patientRadiologyOrdersViewList.isEmpty) { - return Utils.getNoDataWidget(ctx, noDataText: "You don't have any radiology results yet.".needTranslation); + return Utils.getNoDataWidget(ctx, noDataText: LocaleKeys.youDontHaveRadiologyOrders.tr(context: context)); } return ListView.builder( @@ -239,7 +239,7 @@ class _RadiologyOrdersPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppCustomChipWidget(labelText: "${group.length} ${'results'.needTranslation}"), + AppCustomChipWidget(labelText: "${group.length} ${LocaleKeys.results.tr(context: context)}"), Icon(isExpanded ? Icons.expand_less : Icons.expand_more), ], ), @@ -323,7 +323,7 @@ class _RadiologyOrdersPageState extends State { icon: AppAssets.view_report_icon, iconColor: AppColors.primaryRedColor, iconSize: 16.h, - text: "View Results".needTranslation, + text: LocaleKeys.viewResults.tr(context: context), onPressed: () { model.navigationService.push( CustomPageRoute( diff --git a/lib/presentation/radiology/radiology_result_page.dart b/lib/presentation/radiology/radiology_result_page.dart index 1fc2d9f..2328d0e 100644 --- a/lib/presentation/radiology/radiology_result_page.dart +++ b/lib/presentation/radiology/radiology_result_page.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; @@ -10,6 +11,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/radiology/models/resp_models/patient_radiology_response_model.dart'; import 'package:hmg_patient_app_new/features/radiology/radiology_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; @@ -49,7 +51,7 @@ class _RadiologyResultPageState extends State { children: [ Expanded( child: CollapsingListView( - title: "Radiology Result".needTranslation, + title: LocaleKeys.radiologyResult.tr(context: context), child: SingleChildScrollView( child: Padding( padding: EdgeInsets.symmetric(horizontal: 24.h), @@ -72,13 +74,13 @@ class _RadiologyResultPageState extends State { widget.patientRadiologyResponseModel.reportData!.trim().toText12(isBold: true, color: AppColors.textColorLight), SizedBox(height: 16.h), CustomButton( - text: "View Radiology Image".needTranslation, + text: LocaleKeys.viewRadiologyImage.tr(context: context), onPressed: () async { if (radiologyViewModel.radiologyImageURL.isNotEmpty) { Uri uri = Uri.parse(radiologyViewModel.radiologyImageURL); launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: ""); } else { - Utils.showToast("Radiology image not available".needTranslation); + Utils.showToast("Radiology image not available"); } }, backgroundColor: AppColors.primaryRedColor, @@ -111,7 +113,7 @@ class _RadiologyResultPageState extends State { hasShadow: true, ), child: CustomButton( - text: "Download report".needTranslation, + text: LocaleKeys.downloadReport.tr(context: context), onPressed: () async { LoaderBottomSheet.showLoader(); await radiologyViewModel.getRadiologyPDF(patientRadiologyResponseModel: widget.patientRadiologyResponseModel, authenticatedUser: _appState.getAuthenticatedUser()!, onError: (err) { @@ -132,7 +134,7 @@ class _RadiologyResultPageState extends State { } catch (ex) { showCommonBottomSheetWithoutHeight( context, - child: Utils.getErrorWidget(loadingText: "Cannot open file".needTranslation), + child: Utils.getErrorWidget(loadingText: "Cannot open file"), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true, diff --git a/lib/presentation/rate_appointment/rate_appointment_clinic.dart b/lib/presentation/rate_appointment/rate_appointment_clinic.dart index 5fb1fa3..e7e29f6 100644 --- a/lib/presentation/rate_appointment/rate_appointment_clinic.dart +++ b/lib/presentation/rate_appointment/rate_appointment_clinic.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; @@ -5,6 +6,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/my_appointments/appointment_rating_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/rate_appointment/widget/doctor_row.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; @@ -77,9 +79,7 @@ class _RateAppointmentClinicState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - - "Rate Clinic".needTranslation.toText16(isBold: true), - + LocaleKeys.rateClinic.tr(context: context).toText16(isBold: true), SizedBox(height: 12), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -147,13 +147,13 @@ class _RateAppointmentClinicState extends State { children: [ Expanded( child: CustomButton( - text: "Back".needTranslation, + text: LocaleKeys.back.tr(context: context), backgroundColor: Color(0xffFEE9EA), borderColor: Color(0xffFEE9EA), textColor: Color(0xffED1C2B), onPressed: () { - appointmentRatingViewModel!.setTitle("Rate Doctor".needTranslation); - appointmentRatingViewModel!.setSubTitle("How was your last visit with doctor?".needTranslation); + appointmentRatingViewModel!.setTitle(LocaleKeys.rateDoctor.tr(context: context)); + appointmentRatingViewModel!.setSubTitle(LocaleKeys.howWasYourLastVisitWithDoctor.tr(context: context)); appointmentRatingViewModel!.setClinicOrDoctor(false); setState(() { @@ -164,7 +164,7 @@ class _RateAppointmentClinicState extends State { SizedBox(width: 10), Expanded( child: CustomButton( - text: "Submit".needTranslation, + text: LocaleKeys.submit.tr(context: context), onPressed: () { submitRating(); diff --git a/lib/presentation/rate_appointment/rate_appointment_doctor.dart b/lib/presentation/rate_appointment/rate_appointment_doctor.dart index ac79744..b9a6c58 100644 --- a/lib/presentation/rate_appointment/rate_appointment_doctor.dart +++ b/lib/presentation/rate_appointment/rate_appointment_doctor.dart @@ -1,9 +1,11 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/my_appointments/appointment_rating_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/rate_appointment/rate_appointment_clinic.dart'; import 'package:hmg_patient_app_new/presentation/rate_appointment/widget/doctor_row.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; @@ -88,9 +90,7 @@ class _RateAppointmentDoctorState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - - "Please rate the doctor".needTranslation.toText16(isBold: true), - + "Please rate the doctor".toText16(isBold: true), SizedBox(height: 12), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -142,7 +142,7 @@ class _RateAppointmentDoctorState extends State { maxLines: 4, decoration: InputDecoration.collapsed( - hintText: "Notes".needTranslation, + hintText: LocaleKeys.notes.tr(context: context), hintStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -172,7 +172,7 @@ class _RateAppointmentDoctorState extends State { children: [ Expanded( child: CustomButton( - text: "Later".needTranslation, + text: "Later", backgroundColor: Color(0xffFEE9EA), borderColor: Color(0xffFEE9EA), textColor: Color(0xffED1C2B), @@ -184,11 +184,11 @@ class _RateAppointmentDoctorState extends State { SizedBox(width: 10), Expanded( child: CustomButton( - text: "Next".needTranslation, + text: LocaleKeys.next.tr(context: context), onPressed: () { // Set up clinic rating and show clinic rating view - appointmentRatingViewModel!.setTitle("Rate Clinic".needTranslation); - appointmentRatingViewModel!.setSubTitle("How was your appointment?".needTranslation); + appointmentRatingViewModel!.setTitle(LocaleKeys.rateDoctor.tr(context: context),); + appointmentRatingViewModel!.setSubTitle(LocaleKeys.howWasYourLastVisitWithDoctor.tr(context: context),); appointmentRatingViewModel!.setClinicOrDoctor(true); setState(() {}); diff --git a/lib/presentation/symptoms_checker/organ_selector_screen.dart b/lib/presentation/symptoms_checker/organ_selector_screen.dart index 1786dec..cc956dc 100644 --- a/lib/presentation/symptoms_checker/organ_selector_screen.dart +++ b/lib/presentation/symptoms_checker/organ_selector_screen.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; @@ -9,6 +10,7 @@ import 'package:hmg_patient_app_new/extensions/route_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/widgets/interactive_body_widget.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; @@ -38,11 +40,11 @@ class _OrganSelectorPageState extends State { void _onNextPressed(SymptomsCheckerViewModel viewModel) async { if (!viewModel.validateSelection()) { dialogService.showErrorBottomSheet( - message: 'Please select at least one organ'.needTranslation, + message: LocaleKeys.noOrgansSelected.tr(context: context), ); return; } - LoaderBottomSheet.showLoader(loadingText: "Please wait".needTranslation); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.pleaseWait.tr(context: context),); final String userName = 'guest_user'; final String password = '123456'; @@ -112,7 +114,7 @@ class _OrganSelectorPageState extends State { return Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Text( - "Organ Selector".needTranslation, + LocaleKeys.organSelector.tr(context: context), style: TextStyle( color: AppColors.textColor, fontSize: 22.f, @@ -249,7 +251,7 @@ class _OrganSelectorPageState extends State { return Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Text( - 'Selected Organs'.needTranslation, + LocaleKeys.selectedOrgans.tr(context: context), style: TextStyle( fontSize: 16.f, fontWeight: FontWeight.w600, @@ -264,7 +266,7 @@ class _OrganSelectorPageState extends State { return Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Text( - 'No organs selected yet'.needTranslation, + LocaleKeys.noOrgansSelected.tr(context: context), style: TextStyle( color: AppColors.greyTextColor, fontSize: 14.f, @@ -301,7 +303,7 @@ class _OrganSelectorPageState extends State { return Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: CustomButton( - text: 'Next'.needTranslation, + text: LocaleKeys.next.tr(context: context), onPressed: () => _onNextPressed(viewModel), isDisabled: viewModel.selectedOrgans.isEmpty, backgroundColor: AppColors.primaryRedColor, diff --git a/lib/presentation/symptoms_checker/possible_conditions_screen.dart b/lib/presentation/symptoms_checker/possible_conditions_screen.dart index a63d1e2..bc233a4 100644 --- a/lib/presentation/symptoms_checker/possible_conditions_screen.dart +++ b/lib/presentation/symptoms_checker/possible_conditions_screen.dart @@ -51,7 +51,7 @@ class PossibleConditionsPage extends StatelessWidget { child: Padding( padding: EdgeInsets.all(24.h), child: Text( - 'No Predictions available'.needTranslation, + LocaleKeys.noPredictionsAvailable.tr(context: context), style: TextStyle( fontSize: 16.h, color: AppColors.greyTextColor, @@ -102,7 +102,7 @@ class PossibleConditionsPage extends StatelessWidget { title: LocaleKeys.notice.tr(context: context), context, child: Utils.getWarningWidget( - loadingText: "Are you sure you want to restart the organ selection?".needTranslation, + loadingText: LocaleKeys.areYouSureYouWantToRestartOrganSelection.tr(context: context), isShowActionButtons: true, onCancelTap: () => Navigator.pop(context), onConfirmTap: () => onConfirm(), @@ -161,7 +161,7 @@ class PossibleConditionsPage extends StatelessWidget { return Scaffold( backgroundColor: AppColors.bgScaffoldColor, body: CollapsingListView( - title: "Possible Conditions".needTranslation, + title: LocaleKeys.possibleConditions.tr(context: context), trailing: _buildTrailingSection(context), child: Consumer( builder: (context, symptomsCheckerViewModel, child) { diff --git a/lib/presentation/symptoms_checker/risk_factors_screen.dart b/lib/presentation/symptoms_checker/risk_factors_screen.dart index 8669c3c..6ee4f29 100644 --- a/lib/presentation/symptoms_checker/risk_factors_screen.dart +++ b/lib/presentation/symptoms_checker/risk_factors_screen.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; @@ -8,6 +9,7 @@ import 'package:hmg_patient_app_new/extensions/route_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; @@ -44,7 +46,7 @@ class _RiskFactorsScreenState extends State { context.navigateWithName(AppRoutes.suggestionsPage); } else { dialogService.showErrorBottomSheet( - message: 'Please select at least one risk before proceeding'.needTranslation, + message: LocaleKeys.pleaseSelectAtLeastOneRiskBeforeProceeding.tr(context: context), ); } } @@ -121,11 +123,10 @@ class _RiskFactorsScreenState extends State { ), children: [ TextSpan( - text: "Above you see the most common risk factors. Although /diagnosis may return questions about risk factors, " - .needTranslation, + text: LocaleKeys.aboveYouSeeCommonRiskFactors.tr(context: context), ), TextSpan( - text: "read more".needTranslation, + text: LocaleKeys.readMore.tr(context: context), style: TextStyle( color: AppColors.primaryRedColor, fontWeight: FontWeight.w500, @@ -216,7 +217,7 @@ class _RiskFactorsScreenState extends State { children: [ Expanded( child: CollapsingListView( - title: "Risk Factors".needTranslation, + title: LocaleKeys.riskFactors.tr(context: context), leadingCallback: () => context.pop(), child: viewModel.isRiskFactorsLoading ? _buildLoadingShimmer() @@ -249,7 +250,7 @@ class _RiskFactorsScreenState extends State { Icon(Icons.info_outline, size: 64.h, color: AppColors.greyTextColor), SizedBox(height: 16.h), Text( - 'No risk factors found'.needTranslation, + LocaleKeys.noRiskFactorsFound.tr(context: context), style: TextStyle( fontSize: 18.f, fontWeight: FontWeight.w600, @@ -258,7 +259,7 @@ class _RiskFactorsScreenState extends State { ), SizedBox(height: 8.h), Text( - 'Based on your selected symptoms, no additional risk factors were identified.'.needTranslation, + LocaleKeys.basedOnYourSelectedSymptomsNoRiskFactors.tr(context: context), textAlign: TextAlign.center, style: TextStyle( fontSize: 14.f, @@ -282,7 +283,7 @@ class _RiskFactorsScreenState extends State { children: [ Expanded( child: CustomButton( - text: "Previous".needTranslation, + text: LocaleKeys.previous.tr(context: context), onPressed: _onPreviousPressed, backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.11), borderColor: Colors.transparent, @@ -293,7 +294,7 @@ class _RiskFactorsScreenState extends State { SizedBox(width: 12.w), Expanded( child: CustomButton( - text: "Next".needTranslation, + text: LocaleKeys.next.tr(context: context), onPressed: () => _onNextPressed(viewModel), backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, diff --git a/lib/presentation/symptoms_checker/user_info_selection/pages/age_selection_page.dart b/lib/presentation/symptoms_checker/user_info_selection/pages/age_selection_page.dart index 8366545..37802a2 100644 --- a/lib/presentation/symptoms_checker/user_info_selection/pages/age_selection_page.dart +++ b/lib/presentation/symptoms_checker/user_info_selection/pages/age_selection_page.dart @@ -1,8 +1,10 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/user_info_selection/widgets/custom_date_picker.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:provider/provider.dart'; @@ -25,7 +27,7 @@ class AgeSelectionPage extends StatelessWidget { builder: (BuildContext context, symptomsViewModel, Widget? child) { return Column( children: [ - "What is your Date of Birth?".needTranslation.toText18(weight: FontWeight.w600, color: AppColors.textColor).paddingAll(24.w), + LocaleKeys.dateOfBirthSymptoms.tr(context: context).toText18(weight: FontWeight.w600, color: AppColors.textColor).paddingAll(24.w), SizedBox(height: 30.h), ThreeColumnDatePicker( enableHaptic: true, diff --git a/lib/presentation/symptoms_checker/user_info_selection/pages/gender_selection_page.dart b/lib/presentation/symptoms_checker/user_info_selection/pages/gender_selection_page.dart index 85cb6e2..6eaae8c 100644 --- a/lib/presentation/symptoms_checker/user_info_selection/pages/gender_selection_page.dart +++ b/lib/presentation/symptoms_checker/user_info_selection/pages/gender_selection_page.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; @@ -5,6 +6,7 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:provider/provider.dart'; @@ -48,21 +50,21 @@ class GenderSelectionPage extends StatelessWidget { builder: (BuildContext context, symptomsViewModel, Widget? child) { return Column( children: [ - "What is your gender?".needTranslation.toText18(weight: FontWeight.w600, color: AppColors.textColor), + LocaleKeys.genderSymptoms.tr(context: context).toText18(weight: FontWeight.w600, color: AppColors.textColor), SizedBox(height: 70.h), Row( children: [ Expanded( child: InkWell( onTap: () => onGenderSelected(genders[0]), - child: _buildGenderOption(AppAssets.maleIcon, "Male".needTranslation, symptomsViewModel.selectedGender == genders[0]), + child: _buildGenderOption(AppAssets.maleIcon, LocaleKeys.malE.tr(context: context), symptomsViewModel.selectedGender == genders[0]), ), ), SizedBox(width: 16.w), Expanded( child: InkWell( onTap: () => onGenderSelected(genders[1]), - child: _buildGenderOption(AppAssets.femaleIcon, "Female".needTranslation, symptomsViewModel.selectedGender == genders[1]), + child: _buildGenderOption(AppAssets.femaleIcon, LocaleKeys.femaleGender.tr(context: context), symptomsViewModel.selectedGender == genders[1]), )) ], ), diff --git a/lib/presentation/symptoms_checker/user_info_selection/pages/height_selection_page.dart b/lib/presentation/symptoms_checker/user_info_selection/pages/height_selection_page.dart index 0744e81..65cf5a5 100644 --- a/lib/presentation/symptoms_checker/user_info_selection/pages/height_selection_page.dart +++ b/lib/presentation/symptoms_checker/user_info_selection/pages/height_selection_page.dart @@ -1,10 +1,12 @@ import 'dart:developer'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/user_info_selection/widgets/height_scale.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:provider/provider.dart'; @@ -107,7 +109,7 @@ class HeightSelectionPage extends StatelessWidget { SizedBox(height: 24.h), Center( child: Text( - 'How tall are you?'.needTranslation, + LocaleKeys.heightSymptoms.tr(context: context), style: TextStyle(fontSize: 18.f, fontWeight: FontWeight.w600, color: AppColors.textColor), ), ), diff --git a/lib/presentation/symptoms_checker/user_info_selection/pages/weight_selection_page.dart b/lib/presentation/symptoms_checker/user_info_selection/pages/weight_selection_page.dart index 1d38a91..8c83796 100644 --- a/lib/presentation/symptoms_checker/user_info_selection/pages/weight_selection_page.dart +++ b/lib/presentation/symptoms_checker/user_info_selection/pages/weight_selection_page.dart @@ -1,10 +1,12 @@ import 'dart:developer'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/user_info_selection/widgets/weight_scale.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:provider/provider.dart'; @@ -113,7 +115,7 @@ class WeightSelectionPage extends StatelessWidget { SizedBox(height: 24.h), Center( child: Text( - 'What is your weight?'.needTranslation, + LocaleKeys.weightSymptoms.tr(context: context), style: TextStyle(fontSize: 18.f, fontWeight: FontWeight.w600, color: AppColors.textColor), ), ), diff --git a/lib/presentation/symptoms_checker/user_info_selection/user_info_flow_manager.dart b/lib/presentation/symptoms_checker/user_info_selection/user_info_flow_manager.dart index 523470e..b5df05b 100644 --- a/lib/presentation/symptoms_checker/user_info_selection/user_info_flow_manager.dart +++ b/lib/presentation/symptoms_checker/user_info_selection/user_info_flow_manager.dart @@ -1,10 +1,12 @@ import 'dart:developer'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/extensions/route_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/user_info_selection/pages/age_selection_page.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/user_info_selection/pages/gender_selection_page.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/user_info_selection/pages/height_selection_page.dart'; @@ -184,7 +186,7 @@ class _UserInfoFlowManagerState extends State { child: isSingleEdit ? // Single page edit mode - show only Save button CustomButton( - text: "Save".needTranslation, + text: LocaleKeys.save.tr(context: context), onPressed: _onNext, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, @@ -197,7 +199,7 @@ class _UserInfoFlowManagerState extends State { if (!isFirstPage) ...[ Expanded( child: CustomButton( - text: "Previous".needTranslation, + text: LocaleKeys.previous.tr(context: context), onPressed: _onPrevious, backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.11), borderColor: Colors.transparent, @@ -209,7 +211,7 @@ class _UserInfoFlowManagerState extends State { ], Expanded( child: CustomButton( - text: isLastPage ? "Submit".needTranslation : "Next".needTranslation, + text: isLastPage ? LocaleKeys.submit.tr(context: context) : LocaleKeys.next.tr(context: context), onPressed: _onNext, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, @@ -233,7 +235,7 @@ class _UserInfoFlowManagerState extends State { Expanded( child: CollapsingListView( physics: NeverScrollableScrollPhysics(), - title: _pageTitles[_viewModel.userInfoCurrentPage].needTranslation, + title: _pageTitles[_viewModel.userInfoCurrentPage], isLeading: true, child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/presentation/symptoms_checker/widgets/condition_card.dart b/lib/presentation/symptoms_checker/widgets/condition_card.dart index 87a8f3d..b89eac2 100644 --- a/lib/presentation/symptoms_checker/widgets/condition_card.dart +++ b/lib/presentation/symptoms_checker/widgets/condition_card.dart @@ -1,9 +1,11 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/widgets/custom_progress_bar.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; @@ -156,12 +158,12 @@ class ConditionCard extends StatelessWidget { ), _buildSymptomsRow(), SizedBox(height: 16.h), - Text("Description".needTranslation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.f, color: AppColors.textColor)), + Text(LocaleKeys.description.tr(context: context), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.f, color: AppColors.textColor)), SizedBox(height: 2.h), Text(description, style: TextStyle(color: AppColors.greyTextColor, fontWeight: FontWeight.w500, fontSize: 12.f)), if (possibleConditionsSeverityEnum == PossibleConditionsSeverityEnum.emergency) CustomButton( - text: appointmentLabel ?? "Book Appointment".needTranslation, + text: appointmentLabel ?? LocaleKeys.bookAppointment.tr(context: context), onPressed: () { if (onActionPressed != null) { onActionPressed!(); diff --git a/lib/presentation/symptoms_checker/widgets/selected_organs_section.dart b/lib/presentation/symptoms_checker/widgets/selected_organs_section.dart index c0f1be3..b66ef03 100644 --- a/lib/presentation/symptoms_checker/widgets/selected_organs_section.dart +++ b/lib/presentation/symptoms_checker/widgets/selected_organs_section.dart @@ -1,8 +1,10 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/models/organ_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; @@ -52,7 +54,7 @@ class _SelectedOrgansSectionState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - 'Selected Organs'.needTranslation, + LocaleKeys.selectedOrgans.tr(context: context), style: TextStyle( fontSize: 16.f, fontWeight: FontWeight.w600, @@ -101,7 +103,7 @@ class _SelectedOrgansSectionState extends State { Padding( padding: EdgeInsets.symmetric(vertical: 8.h), child: Text( - 'No organs selected yet'.needTranslation, + LocaleKeys.noOrgansSelected.tr(context: context), style: TextStyle( color: AppColors.greyTextColor, fontSize: 14.f, diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index ebc7165..bf665ea 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -37,7 +37,6 @@ import '../presentation/covid19test/covid19_landing_page.dart'; import '../core/dependencies.dart'; import '../features/monthly_reports/monthly_reports_repo.dart'; import '../features/monthly_reports/monthly_reports_view_model.dart'; -import '../presentation/monthly_reports/monthly_reports_page.dart'; import '../presentation/parking/paking_page.dart'; import '../services/error_handler_service.dart'; import 'package:provider/provider.dart'; @@ -140,7 +139,6 @@ class AppRoutes { monthlyReportsRepo: getIt(), errorHandlerService: getIt(), ), - child: const MonthlyReportsPage(), ), qrParking: (context) => ChangeNotifierProvider( create: (_) => getIt(),