Compare commits

...

7 Commits

@ -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": "جاري إرسال ال<D8A7><D984>ريد الإلكتروني، يرجى الانتظار...",
"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": "بناءً على الأعراض المحددة، لم يتم تحديد عوامل خطر إضافية."
}

@ -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"
}
"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."
}

@ -151,6 +151,7 @@ var GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
///LiveChat
var GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects';
var GET_LIVECHAT_REQUEST_ID = 'Services/Patients.svc/REST/Patient_ICChatRequest_Insert';
///babyInformation
var GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID';

@ -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();

@ -215,14 +215,14 @@ showReminderBottomSheet(BuildContext context, DateTime dateTime, String doctorNa
Future<void> _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: '');

@ -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,

@ -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();

@ -14,6 +14,8 @@ abstract class ContactUsRepo {
Future<Either<Failure, GenericApiModel<List<GetPatientICProjectsModel>>>> getLiveChatProjectsList();
Future<Either<Failure, GenericApiModel<String>>> getChatRequestID({required String name, required String mobileNo, required String workGroup});
Future<Either<Failure, GenericApiModel<dynamic>>> insertCOCItem({required RequestInsertCOCItem requestInsertCOCItem, PatientAppointmentHistoryResponseModel? patientSelectedAppointment});
}
@ -97,6 +99,45 @@ class ContactUsRepoImp implements ContactUsRepo {
}
}
@override
Future<Either<Failure, GenericApiModel<String>>> getChatRequestID({required String name, required String mobileNo, required String workGroup}) async {
Map<String, dynamic> body = {};
body['Name'] = name;
body['MobileNo'] = mobileNo;
body['WorkGroup'] = workGroup;
try {
GenericApiModel<String>? apiResponse;
Failure? failure;
await apiClient.post(
GET_LIVECHAT_REQUEST_ID,
body: body,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final requestId = response['RequestId'] as String;
apiResponse = GenericApiModel<String>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: requestId,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel<dynamic>>> insertCOCItem({required RequestInsertCOCItem requestInsertCOCItem, PatientAppointmentHistoryResponseModel? patientSelectedAppointment}) async {
final Map<String, dynamic> body = requestInsertCOCItem.toJson();

@ -29,6 +29,8 @@ class ContactUsViewModel extends ChangeNotifier {
int selectedLiveChatProjectIndex = -1;
String? chatRequestID;
List<String> feedbackAttachmentList = [];
PatientAppointmentHistoryResponseModel? patientFeedbackSelectedAppointment;
@ -153,6 +155,32 @@ class ContactUsViewModel extends ChangeNotifier {
);
}
Future<void> getChatRequestID({required String name, required String mobileNo, required String workGroup, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await contactUsRepo.getChatRequestID(name: name, mobileNo: mobileNo, workGroup: workGroup);
result.fold(
(failure) async {
await errorHandlerService.handleError(failure: failure);
if (onError != null) {
onError(failure.toString());
}
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
if (onError != null) {
onError(apiResponse.errorMessage ?? 'Unknown error');
}
} else if (apiResponse.messageStatus == 1) {
chatRequestID = apiResponse.data;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> insertCOCItem({required String subject, required String message, Function(dynamic)? onSuccess, Function(String)? onError}) async {
RequestInsertCOCItem requestInsertCOCItem = RequestInsertCOCItem();
requestInsertCOCItem.attachment = feedbackAttachmentList.isNotEmpty ? feedbackAttachmentList.first : "";

@ -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<AuthenticationViewModel>().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<void> 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<AuthenticationViewModel>().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<void> 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<void> 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<void> 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<void> 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<AuthenticationViewModel>().onLoginPressed();
@ -1072,12 +1068,11 @@ class EmergencyServicesViewModel extends ChangeNotifier {
}
FutureOr<void> 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),

@ -940,7 +940,16 @@ class HmgServicesRepoImp implements HmgServicesRepo {
for (var vitalSignJson in vitalSignsList) {
if (vitalSignJson is Map<String, dynamic>) {
vitalSignList.add(VitalSignResModel.fromJson(vitalSignJson));
final vitalSign = VitalSignResModel.fromJson(vitalSignJson);
// Only add records where BOTH height AND weight are greater than 0
final hasValidWeight = _isValidValue(vitalSign.weightKg);
final hasValidHeight = _isValidValue(vitalSign.heightCm);
// Only add if both height and weight are valid (> 0)
if (hasValidWeight && hasValidHeight) {
vitalSignList.add(vitalSign);
}
}
}
}
@ -967,5 +976,22 @@ class HmgServicesRepoImp implements HmgServicesRepo {
}
}
/// Helper method to check if a value is valid (greater than 0)
bool _isValidValue(dynamic value) {
if (value == null) return false;
if (value is num) {
return value > 0;
}
if (value is String) {
if (value.trim().isEmpty) return false;
final parsed = double.tryParse(value);
return parsed != null && parsed > 0;
}
return false;
}
}

@ -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();
}
}

@ -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<AppState>().isGMSAvailable,
),
direction: AxisDirection.down),

@ -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());
}
}
}

@ -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',
);

@ -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';
}

@ -129,9 +129,13 @@ class LiveChatPage extends StatelessWidget {
).paddingSymmetrical(16.h, 16.h),
).onPress(() {
contactUsVM.setSelectedLiveChatProjectIndex(index);
chatURL =
"https://chat.hmg.com/Index.aspx?Name=${appState.getAuthenticatedUser()!.firstName}&PatientID=${appState.getAuthenticatedUser()!.patientId}&MobileNo=${appState.getAuthenticatedUser()!.mobileNumber}&Language=${appState.isArabic() ? 'ar' : 'en'}&WorkGroup=${contactUsVM.liveChatProjectsList[index].value}";
debugPrint("Chat URL: $chatURL");
_getChatRequestID(
context,
contactUsVM,
name: appState.getAuthenticatedUser()!.firstName ?? '',
mobileNo: appState.getAuthenticatedUser()!.mobileNumber ?? '',
workGroup: contactUsVM.liveChatProjectsList[index].value ?? '',
);
}),
).paddingSymmetrical(24.h, 0.h),
),
@ -154,8 +158,14 @@ class LiveChatPage extends StatelessWidget {
child: CustomButton(
text: LocaleKeys.liveChat.tr(context: context),
onPressed: () async {
Uri uri = Uri.parse(chatURL);
launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: "");
if (contactUsVM.chatRequestID != null) {
chatURL = "https://chat.hmg.com/Index.aspx?RequestedId=${contactUsVM.chatRequestID}";
debugPrint("Chat URL: $chatURL");
Uri uri = Uri.parse(chatURL);
launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: "");
} else {
debugPrint("Chat Request ID is null");
}
},
backgroundColor: contactUsVM.selectedLiveChatProjectIndex == -1 ? AppColors.greyColor : AppColors.primaryRedColor,
borderColor: contactUsVM.selectedLiveChatProjectIndex == -1 ? AppColors.greyColor : AppColors.primaryRedColor,
@ -172,4 +182,20 @@ class LiveChatPage extends StatelessWidget {
}),
);
}
void _getChatRequestID(BuildContext context, ContactUsViewModel contactUsVM, {required String name, required String mobileNo, required String workGroup}) {
contactUsVM.getChatRequestID(
name: name,
mobileNo: mobileNo,
workGroup: workGroup,
onSuccess: (response) {
debugPrint("Chat Request ID received: ${contactUsVM.chatRequestID}");
chatURL = "https://chat.hmg.com/Index.aspx?RequestedId=${contactUsVM.chatRequestID}";
debugPrint("Chat URL: $chatURL");
},
onError: (error) {
debugPrint("Error getting chat request ID: $error");
},
);
}
}

@ -275,11 +275,11 @@ class _LandingPageState extends State<LandingPage> {
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<LandingPage> {
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<LandingPage> {
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<LandingPage> {
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<LandingPage> {
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<LandingPage> {
],
),
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<LandingPage> {
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<LandingPage> {
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<LandingPage> {
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<LandingPage> {
],
),
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<Duration>(
valueListenable: immediateLiveCareViewModel.durationNotifier,

@ -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,

@ -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();
},

@ -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,

@ -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<HhcOrderDetailPage> {
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<HhcOrderDetailPage> {
),
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<HhcOrderDetailPage> {
@override
Widget build(BuildContext context) {
return CollapsingListView(
title: "HHC Orders".needTranslation,
title: LocaleKeys.hhcOrders.tr(context: context),
isLeading: true,
child: SingleChildScrollView(
child: Column(

@ -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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
),
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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
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<HhcProceduresPage> {
Center(
child: Utils.getNoDataWidget(
context,
noDataText: "You have no pending requests.".needTranslation,
noDataText: LocaleKeys.youHaveNoPendingRequests.tr(context: context),
),
),
],

@ -50,7 +50,7 @@ class _HhcSelectionReviewPageState extends State<HhcSelectionReviewPage> {
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<HhcSelectionReviewPage> {
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<HhcSelectionReviewPage> {
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<HhcSelectionReviewPage> {
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<HhcSelectionReviewPage> {
),
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<HhcSelectionReviewPage> {
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<HhcSelectionReviewPage> {
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);

@ -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: [

@ -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),
],
),

@ -95,7 +95,7 @@ class _InsuranceApprovalsPageState extends State<InsuranceApprovalsPage> {
),
),
)
: 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),
),

@ -78,7 +78,7 @@ class _InsuranceHomePageState extends State<InsuranceHomePage> {
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,

@ -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),

@ -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,

@ -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,
),

@ -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),

@ -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,
),

File diff suppressed because one or more lines are too long

@ -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,

@ -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<LabViewModel>().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(),

@ -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,

@ -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) ??

@ -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}', ''),

@ -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),
),

@ -195,8 +195,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
).withHorizontalPadding(24.w).onPress(() {
DialogService dialogService = getIt.get<DialogService>();
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<MedicalFilePage> {
Consumer<InsuranceViewModel>(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<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
}),
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<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
});
} else {
LoaderBottomSheet.hideLoader();
print("Doctor is not available");
}
},
onError: (_) {
@ -705,7 +704,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
).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<MedicalFilePage> {
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<MedicalFilePage> {
],
).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<PrescriptionsViewModel>(builder: (context, prescriptionVM, child) {
return prescriptionVM.isPrescriptionsOrdersLoading
@ -836,7 +835,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
),
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<MedicalFilePage> {
),
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<MedicalFilePage> {
).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<MedicalFilePage> {
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<MedicalFilePage> {
);
}),
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<MedicalFilePage> {
);
}),
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<MedicalFilePage> {
),
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<MedicalFilePage> {
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<MedicalFilePage> {
);
}),
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<MedicalFilePage> {
);
}),
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<MedicalFilePage> {
),
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<MedicalFilePage> {
);
}),
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<MedicalFilePage> {
);
}),
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<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
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<MedicalFilePage> {
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),

@ -245,7 +245,7 @@ class _PatientSickleavesListPageState extends State<PatientSickleavesListPage> {
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<PatientSickleavesListPage> {
),
),
)
: 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),
],

@ -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<VaccineListPage> {
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: CollapsingListView(
title: "Vaccine Info".needTranslation,
title: LocaleKeys.vaccineInfo.tr(context: context),
child: SingleChildScrollView(
child: Consumer<MedicalFileViewModel>(builder: (context, medicalFileVM, child) {
return Column(
@ -170,7 +172,7 @@ class _VaccineListPageState extends State<VaccineListPage> {
),
),
)
: 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),
),

@ -183,7 +183,7 @@ class MedicalFileAppointmentCard extends StatelessWidget {
iconSize: 16.h,
)
: CustomButton(
text: "Rebook".needTranslation,
text: LocaleKeys.rebook.tr(context: context),
onPressed: () {
onRescheduleTap();
},

@ -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,

@ -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<MedicalFileViewModel>(context, listen: false);
return CollapsingListView(
title: "Medical Reports".needTranslation,
title: LocaleKeys.medicalReports.tr(context: context),
isClose: true,
child: Column(
children: [

@ -44,7 +44,7 @@ class _MedicalReportsPageState extends State<MedicalReportsPage> {
children: [
Expanded(
child: CollapsingListView(
title: "Medical Reports".needTranslation,
title: LocaleKeys.medicalReports.tr(context: context),
child: SingleChildScrollView(
child: Consumer<MedicalFileViewModel>(builder: (context, medicalFileVM, child) {
return Column(
@ -88,7 +88,7 @@ class _MedicalReportsPageState extends State<MedicalReportsPage> {
Row(
children: [
CustomButton(
text: "Requested".needTranslation,
text: LocaleKeys.requested.tr(context: context),
onPressed: () {
setState(() {
expandedIndex = null;
@ -300,7 +300,7 @@ class _MedicalReportsPageState extends State<MedicalReportsPage> {
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<MedicalReportsPage> {
),
),
)
: 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<MedicalReportsPage> {
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<MedicalReportsPage> {
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<MedicalReportsPage> {
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<MedicalReportsPage> {
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);

@ -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,

@ -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 its 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,

@ -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<MonthlyReportsPage> createState() => _MonthlyReportsPageState();
}
class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
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<void> _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<MonthlyReportsViewModel>();
// 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,
),
),
),
),
),
);
}
}

@ -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<UserAgreementPage> createState() => _UserAgreementPageState();
}
class _UserAgreementPageState extends State<UserAgreementPage> {
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<TermsConditionsViewModel>(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(),
),
],
),
);
}
}

@ -50,7 +50,7 @@ class _FamilyMedicalScreenState extends State<FamilyMedicalScreen> {
AppState appState = getIt.get<AppState>();
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<FamilyMedicalScreen> {
),
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<DialogService>();
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);
});

@ -54,12 +54,10 @@ class _FamilyCardsState extends State<FamilyCards> {
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<FamilyCards> {
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<FamilyCards> {
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<FamilyCards> {
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);
}
}
}

@ -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(

@ -39,9 +39,9 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
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<MyInvoicesDetailsPage> {
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<MyInvoicesDetailsPage> {
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<MyInvoicesDetailsPage> {
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<MyInvoicesDetailsPage> {
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<MyInvoicesDetailsPage> {
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),

@ -77,7 +77,7 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
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!,

@ -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!();

@ -0,0 +1,284 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.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/notifications/models/resp_models/notification_response_model.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:intl/intl.dart';
import 'package:share_plus/share_plus.dart';
class NotificationDetailsPage extends StatelessWidget {
final NotificationResponseModel notification;
const NotificationDetailsPage({
super.key,
required this.notification,
});
@override
Widget build(BuildContext context) {
// Debug logging
print('=== Notification Details ===');
print('Message: ${notification.message}');
print('MessageType: ${notification.messageType}');
print('MessageTypeData: ${notification.messageTypeData}');
print('VideoURL: ${notification.videoURL}');
print('========================');
return CollapsingListView(
title: "Notification Details".needTranslation,
trailing: IconButton(
icon: Icon(
Icons.share_outlined,
size: 24.h,
color: AppColors.textColor,
),
onPressed: () {
_shareNotification();
},
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 24.h),
// Notification content card
_buildNotificationCard(context),
SizedBox(height: 24.h),
],
).paddingSymmetrical(24.w, 0.h),
),
);
}
Widget _buildNotificationCard(BuildContext context) {
return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: true,
),
padding: EdgeInsets.all(16.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Date and Time row
Row(
children: [
// Time chip with clock icon
Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
decoration: BoxDecoration(
color: AppColors.greyColor,
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.access_time, size: 12.w, color: AppColors.textColor),
SizedBox(width: 4.w),
_formatTime(notification.isSentOn).toText10(
weight: FontWeight.w500,
color: AppColors.textColor,
),
],
),
),
SizedBox(width: 8.w),
// Date chip with calendar icon
Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
decoration: BoxDecoration(
color: AppColors.greyColor,
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.calendar_today, size: 12.w, color: AppColors.textColor),
SizedBox(width: 4.w),
_formatDate(notification.isSentOn).toText10(
weight: FontWeight.w500,
color: AppColors.textColor,
),
],
),
),
],
),
SizedBox(height: 16.h),
// Notification message
if (notification.message != null && notification.message!.isNotEmpty)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'Message'.needTranslation.toText14(
weight: FontWeight.w600,
color: AppColors.greyTextColor,
),
SizedBox(height: 8.h),
notification.message!.toText16(
weight: FontWeight.w400,
color: AppColors.textColor,
maxlines: 100,
),
SizedBox(height: 16.h),
],
),
// Notification image (if MessageType is "image")
if (notification.messageType != null &&
notification.messageType!.toLowerCase() == "image")
Builder(
builder: (context) {
// Try to get image URL from videoURL or messageTypeData
String? imageUrl;
if (notification.videoURL != null && notification.videoURL!.isNotEmpty) {
imageUrl = notification.videoURL;
print('Image URL from videoURL: $imageUrl');
} else if (notification.messageTypeData != null && notification.messageTypeData!.isNotEmpty) {
imageUrl = notification.messageTypeData;
print('Image URL from messageTypeData: $imageUrl');
}
if (imageUrl == null || imageUrl.isEmpty) {
print('No image URL found. videoURL: ${notification.videoURL}, messageTypeData: ${notification.messageTypeData}');
return SizedBox.shrink();
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'Attached Image'.needTranslation.toText14(
weight: FontWeight.w600,
color: AppColors.greyTextColor,
),
SizedBox(height: 8.h),
ClipRRect(
borderRadius: BorderRadius.circular(12.h),
child: Image.network(
imageUrl,
width: double.infinity,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) {
print('Error loading image: $error');
print('Image URL: $imageUrl');
return Container(
height: 200.h,
decoration: BoxDecoration(
color: AppColors.greyColor.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(12.h),
),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.broken_image_outlined,
size: 48.h,
color: AppColors.greyTextColor,
),
SizedBox(height: 8.h),
'Failed to load image'.needTranslation.toText12(
color: AppColors.greyTextColor,
),
SizedBox(height: 4.h),
Text(
imageUrl!,
style: TextStyle(fontSize: 8, color: AppColors.greyTextColor),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
),
);
},
loadingBuilder: (context, child, loadingProgress) {
if (loadingProgress == null) {
print('Image loaded successfully');
return child;
}
return Container(
height: 200.h,
decoration: BoxDecoration(
color: AppColors.greyColor.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(12.h),
),
child: Center(
child: CircularProgressIndicator(
value: loadingProgress.expectedTotalBytes != null
? loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes!
: null,
),
),
);
},
),
),
SizedBox(height: 16.h),
],
);
},
),
// Additional notification info
if (notification.notificationType != null && notification.notificationType!.isNotEmpty)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'Type'.needTranslation.toText14(
weight: FontWeight.w600,
color: AppColors.greyTextColor,
),
SizedBox(height: 8.h),
notification.notificationType!.toText16(
weight: FontWeight.w400,
color: AppColors.textColor,
),
],
),
],
),
);
}
void _shareNotification() async {
final String shareText = '''
${notification.message ?? 'Notification'}
Time: ${_formatTime(notification.isSentOn)}
Date: ${_formatDate(notification.isSentOn)}
${notification.notificationType != null ? '\nType: ${notification.notificationType}' : ''}
'''.trim();
await Share.share(shareText);
}
String _formatTime(String? dateTimeString) {
if (dateTimeString == null || dateTimeString.isEmpty) return '--';
try {
final dateTime = DateUtil.convertStringToDate(dateTimeString);
return DateFormat('hh:mm a').format(dateTime);
} catch (e) {
return '--';
}
}
String _formatDate(String? dateTimeString) {
if (dateTimeString == null || dateTimeString.isEmpty) return '--';
try {
final dateTime = DateUtil.convertStringToDate(dateTimeString);
return DateFormat('dd MMM yyyy').format(dateTime);
} catch (e) {
return '--';
}
}
}

@ -1,15 +1,21 @@
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';
import 'package:hmg_patient_app_new/core/utils/date_util.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/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';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:provider/provider.dart';
import 'package:intl/intl.dart';
class NotificationsListPage extends StatelessWidget {
const NotificationsListPage({super.key});
@ -17,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<NotificationsViewModel>(builder: (context, notificationsVM, child) {
return Container(
@ -46,24 +52,134 @@ class NotificationsListPage extends StatelessWidget {
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 16.h),
// "Notification Title".toText14(),
// SizedBox(height: 8.h),
Row(
children: [
Expanded(child: notificationsVM.notificationsList[index].message!.toText16(isBold: notificationsVM.notificationsList[index].isRead ?? false)),
],
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NotificationDetailsPage(
notification: notificationsVM.notificationsList[index],
),
),
SizedBox(height: 12.h),
DateUtil.formatDateToDate(DateUtil.convertStringToDate(notificationsVM.notificationsList[index].isSentOn!), false).toText14(weight: FontWeight.w500),
1.divider,
],
);
},
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 16.h),
// Message row with red dot for unread
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: notificationsVM.notificationsList[index].message!.toText16(
isBold: (notificationsVM.notificationsList[index].isRead == false),
weight: (notificationsVM.notificationsList[index].isRead == false)
? FontWeight.w600
: FontWeight.w400,
),
),
SizedBox(width: 8.w),
// Red dot for unread notifications ONLY
if (notificationsVM.notificationsList[index].isRead == false)
Container(
width: 8.w,
height: 8.w,
decoration: BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
),
],
),
SizedBox(height: 12.h),
// First row: Time and Date chips with arrow
Row(
children: [
// Time chip with clock icon
Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
decoration: BoxDecoration(
color: AppColors.greyColor,
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.access_time, size: 12.w, color: AppColors.textColor),
SizedBox(width: 4.w),
_formatTime(notificationsVM.notificationsList[index].isSentOn).toText10(
weight: FontWeight.w500,
color: AppColors.textColor,
),
],
),
),
SizedBox(width: 8.w),
// Date chip with calendar icon
Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
decoration: BoxDecoration(
color: AppColors.greyColor,
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.calendar_today, size: 12.w, color: AppColors.textColor),
SizedBox(width: 4.w),
_formatDate(notificationsVM.notificationsList[index].isSentOn).toText10(
weight: FontWeight.w500,
color: AppColors.textColor,
),
],
),
),
Spacer(),
// Arrow icon
Utils.buildSvgWithAssets(
icon: AppAssets.arrow_forward,
width: 16.w,
height: 16.h,
iconColor: AppColors.greyTextColor,
),
],
),
// Second row: Contains Image chip (if MessageType is "image")
if (notificationsVM.notificationsList[index].messageType != null &&
notificationsVM.notificationsList[index].messageType!.toLowerCase() == "image")
Padding(
padding: EdgeInsets.only(top: 8.h),
child: Row(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
decoration: BoxDecoration(
color: AppColors.greyColor,
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.image_outlined, size: 12.w, color: AppColors.textColor),
SizedBox(width: 4.w),
'Contains Image'.toText10(
weight: FontWeight.w500,
color: AppColors.textColor,
),
],
),
),
],
),
),
SizedBox(height: 16.h),
1.divider,
],
),
),
),
),
@ -75,4 +191,24 @@ class NotificationsListPage extends StatelessWidget {
),
);
}
String _formatTime(String? dateTimeString) {
if (dateTimeString == null || dateTimeString.isEmpty) return '--';
try {
final dateTime = DateUtil.convertStringToDate(dateTimeString);
return DateFormat('hh:mm a').format(dateTime);
} catch (e) {
return '--';
}
}
String _formatDate(String? dateTimeString) {
if (dateTimeString == null || dateTimeString.isEmpty) return '--';
try {
final dateTime = DateUtil.convertStringToDate(dateTimeString);
return DateFormat('dd MMM yyyy').format(dateTime);
} catch (e) {
return '--';
}
}
}

@ -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<OnboardingScreen> {
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<OnboardingScreen> {
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<OnboardingScreen> {
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,

@ -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<ParkingPage> {
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<ParkingPage> {
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<ParkingPage> {
),
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,
),
),
),

@ -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<ParkingSlot> {
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<ParkingSlot> {
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<ParkingSlot> {
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<ParkingSlot> {
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,
),
),
],

@ -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();
},

@ -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),
],

@ -62,7 +62,7 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
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<PrescriptionDetailPage> {
} 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<PrescriptionDetailPage> {
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<PrescriptionDetailPage> {
),
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<PrescriptionDetailPage> {
} 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<PrescriptionDetailPage> {
: 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();

@ -54,7 +54,7 @@ class _PrescriptionReminderViewState extends State<PrescriptionReminderView> {
),
child: RadioListTile<int>(
title: Text(
"${_options[index]} minutes before".needTranslation,
"${_options[index]} ${LocaleKeys.minute.tr(context: context)}",
style: TextStyle(
fontSize: 16.h,
fontWeight: FontWeight.w500,

@ -247,7 +247,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
: 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<PrescriptionsListPage> {
),
),
)
: 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),
],

@ -83,7 +83,7 @@ class ProfileSettingsState extends State<ProfileSettings> {
@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<ProfileSettings> {
onAddFamilyMemberPress: () {
DialogService dialogService = getIt.get<DialogService>();
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<ProfileSettings> {
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<AppState>().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward),
],
),
@ -165,7 +165,7 @@ class ProfileSettingsState extends State<ProfileSettings> {
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<ProfileSettings> {
),
],
),
"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<ProfileSettings> {
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<ProfileSettings> {
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<ProfileSettings> {
],
),
),
"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<ProfileSettings> {
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<ProfileSettings> {
}
}, 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<ProfileSettings> {
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,

@ -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,

@ -179,7 +179,7 @@ class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> {
}
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<RadiologyOrdersPage> {
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<RadiologyOrdersPage> {
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(

@ -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<RadiologyResultPage> {
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<RadiologyResultPage> {
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<RadiologyResultPage> {
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<RadiologyResultPage> {
} catch (ex) {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Cannot open file".needTranslation),
child: Utils.getErrorWidget(loadingText: "Cannot open file"),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,

@ -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<RateAppointmentClinic> {
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<RateAppointmentClinic> {
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<RateAppointmentClinic> {
SizedBox(width: 10),
Expanded(
child: CustomButton(
text: "Submit".needTranslation,
text: LocaleKeys.submit.tr(context: context),
onPressed: () {
submitRating();

@ -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<RateAppointmentDoctor> {
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<RateAppointmentDoctor> {
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<RateAppointmentDoctor> {
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<RateAppointmentDoctor> {
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(() {});

@ -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<OrganSelectorPage> {
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<OrganSelectorPage> {
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<OrganSelectorPage> {
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<OrganSelectorPage> {
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<OrganSelectorPage> {
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,

@ -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<SymptomsCheckerViewModel>(
builder: (context, symptomsCheckerViewModel, child) {

@ -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<RiskFactorsScreen> {
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<RiskFactorsScreen> {
),
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<RiskFactorsScreen> {
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<RiskFactorsScreen> {
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<RiskFactorsScreen> {
),
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<RiskFactorsScreen> {
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<RiskFactorsScreen> {
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,

@ -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,

@ -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]),
))
],
),

@ -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),
),
),

@ -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),
),
),

@ -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<UserInfoFlowManager> {
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<UserInfoFlowManager> {
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<UserInfoFlowManager> {
],
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<UserInfoFlowManager> {
Expanded(
child: CollapsingListView(
physics: NeverScrollableScrollPhysics(),
title: _pageTitles[_viewModel.userInfoCurrentPage].needTranslation,
title: _pageTitles[_viewModel.userInfoCurrentPage],
isLeading: true,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -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!();

@ -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<SelectedOrgansSection> {
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<SelectedOrgansSection> {
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,

@ -85,7 +85,8 @@ class AppRoutes {
static const String addHealthTrackerEntryPage = '/addHealthTrackerEntryPage';
static const String healthTrackerDetailPage = '/healthTrackerDetailPage';
static Map<String, WidgetBuilder> get routes => {
static Map<String, WidgetBuilder> get routes =>
{
initialRoute: (context) => SplashPage(),
loginScreen: (context) => LoginScreen(),
landingScreen: (context) => LandingNavigation(),
@ -116,13 +117,19 @@ class AppRoutes {
healthTrackersPage: (context) => HealthTrackersPage(),
vitalSign: (context) => VitalSignPage(),
addHealthTrackerEntryPage: (context) {
final args = ModalRoute.of(context)?.settings.arguments as HealthTrackerTypeEnum?;
final args = ModalRoute
.of(context)
?.settings
.arguments as HealthTrackerTypeEnum?;
return AddHealthTrackerEntryPage(
trackerType: args ?? HealthTrackerTypeEnum.bloodSugar,
);
},
healthTrackerDetailPage: (context) {
final args = ModalRoute.of(context)?.settings.arguments as HealthTrackerTypeEnum?;
final args = ModalRoute
.of(context)
?.settings
.arguments as HealthTrackerTypeEnum?;
return HealthTrackerDetailPage(
trackerType: args ?? HealthTrackerTypeEnum.bloodSugar,
);

Loading…
Cancel
Save