Translation updates

pull/162/head
haroon amjad 2 months ago
parent 39af08ddc3
commit 5feacfaf27

@ -408,7 +408,7 @@
"brand": "العلامة التجارية", "brand": "العلامة التجارية",
"power": "القوة", "power": "القوة",
"diameter": "القطر", "diameter": "القطر",
"remarks": "ملاحظات", "remarks": "ملاحظات: ",
"activeMedications": "الأدوية النشطة", "activeMedications": "الأدوية النشطة",
"expDate": "تاريخ انتهاء الصلاحية النشط:", "expDate": "تاريخ انتهاء الصلاحية النشط:",
"route": "الطريق", "route": "الطريق",
@ -1435,5 +1435,69 @@
"overview": "نظرة عامة", "overview": "نظرة عامة",
"details": "التفاصيل", "details": "التفاصيل",
"healthy": "صحي", "healthy": "صحي",
"warning": "تحذير" "warning": "تحذير",
"vitalSignDetails": "تفاصيل العلامات الحيوية",
"resultOf": "نتيجة {date}",
"resultOfNoDate": "نتيجة --",
"referenceRangeBetween": "النطاق المرجعي: {low} {high} {unit}",
"referenceRangeMin": "النطاق المرجعي: ≥ {low} {unit}",
"referenceRangeMax": "النطاق المرجعي: ≤ {high} {unit}",
"noHistoryAvailable": "لا يوجد تاريخ متاح",
"bmiDescription": "مؤشر كتلة الجسم هو قياس يعتمد على الطول والوزن لتقدير دهون الجسم.",
"heightDescription": "يقاس الطول بالسنتيمتر ويستخدم لحساب مؤشر كتلة الجسم وتوصيات الجرعات.",
"weightDescription": "الوزن يساعد في تتبع الصحة العامة والتغذية والتغيرات مع مرور الوقت.",
"bloodPressureDescription": "ضغط الدم يعكس قوة الدم على جدران الشرايين. يظهر كانقباضي/انبساطي.",
"temperatureDescription": "درجة حرارة الجسم تعكس مدى سخونة جسمك وقد تتغير مع العدوى أو الالتهاب.",
"heartRateDescriptionVital": "معدل ضربات القلب يشير إلى عدد نبضات القلب في الدقيقة.",
"respiratoryRateDescription": "معدل التنفس هو عدد الأنفاس المأخوذة في الدقيقة.",
"bmiAdvice": "حافظ على نظام غذائي متوازن ونشاط منتظم. إذا كان مؤشر كتلة جسمك مرتفعًا أو منخفضًا، فكر في استشارة طبيبك.",
"heightAdvice": "لا حاجة لاتخاذ أي إجراء إلا إذا بدا قياسك غير صحيح. قم بتحديثه في زيارتك القادمة.",
"weightAdvice": "راقب تغيرات الوزن. الزيادة أو الخسارة المفاجئة قد تتطلب استشارة طبية.",
"bloodPressureAdvice": "استمر في تتبع ضغط دمك. يجب مناقشة القراءات المرتفعة أو المنخفضة مع طبيبك.",
"temperatureAdvice": "إذا كان لديك حمى مستمرة أو أعراض، اتصل بمقدم الرعاية الصحية.",
"heartRateAdvice": "تتبع اتجاهات معدل ضربات قلبك. إذا شعرت بدوار أو ألم في الصدر، اطلب الرعاية الطبية.",
"respiratoryRateAdvice": "إذا لاحظت ضيقًا في التنفس أو تنفسًا غير طبيعي، اطلب المشورة الطبية.",
"whatShouldIDoNext": "ماذا يجب أن أفعل بعد ذلك؟",
"customizeDrinkCup": "قم بتخصيص كوب مشروبك",
"tipsToStayHydrated": "نصائح للبقاء رطبًا",
"drinkBeforeYouFeelThirsty": "اشرب قبل أن تشعر بالعطش",
"keepRefillableBottleNextToYou": "احتفظ بزجاجة قابلة لإعادة التعبئة بجانبك",
"trackYourDailyIntakeToStayMotivated": "تتبع كمية الماء اليومية للحفاظ على الحافز",
"chooseSparklingWaterInsteadOfSoda": "اختر الماء الفوار بدلاً من الصودا",
"switchCup": "تبديل الكوب",
"plainWater": "ماء عادي",
"yourGoal": "هدفك",
"remaining": "المتبقي",
"hydrationStatus": "حالة الترطيب",
"areYouSureYouWantToCancelAllWaterReminders": "هل أنت متأكد أنك تريد إلغاء جميع تذكيرات الماء؟",
"remindersSet": "تم ضبط التذكيرات!",
"dailyWaterRemindersScheduledAt": "تم جدولة تذكيرات الماء اليومية في:",
"waterConsumption": "استهلاك المياه",
"selectNumberOfReminders": "حدد عدد التذكيرات",
"h2oSettings": "إعدادات H20",
"settingsSavedSuccessfully": "تم حفظ الإعدادات بنجاح",
"yourName": "اسمك",
"ageYears": "العمر (11-120) سنة",
"numberOfRemindersInADay": "عدد التذكيرات في اليوم",
"medications": "الأدوية",
"someRemarksAboutPrescription": "ستجدون هنا بعض الملاحظات حول الوصفة الطبية",
"notifyMeBeforeConsumptionTime": "أبلغني قبل وقت الاستهلاك",
"noMedicationsToday": "لا أدوية اليوم",
"route": "Route: {route}",
"frequency": "Frequency: {frequency}",
"instruction": "Instruction: {instruction}",
"duration": "Duration: {days}",
"reminders": "تذكيرات",
"reminderAddedToCalendar": "تمت إضافة تذكير إلى التقويم ✅",
"errorWhileSettingCalendar": "حدث خطأ أثناء ضبط التقويم:{error}",
"instructions": "التعليمات",
"requests": "الطلبات",
"thisWeek": "هذا الأسبوع",
"lastMonth": "الشهر الماضي",
"lastSixMonths": "آخر 6 أشهر",
"selectTime": "حدد الوقت",
"pleaseWaitYouWillBeCalledForVitalSigns": "يرجى الانتظار! سيتم استدعاؤك لقياس العلامات الحيوية",
"pleaseVisitRoomForVitalSigns": "يرجى زيارة الغرفة {roomNumber} لقياس العلامات الحيوية",
"pleaseVisitRoomToTheDoctor": "يرجى زيارة الغرفة {roomNumber} لمقابلة الطبيب"
} }

@ -406,11 +406,8 @@
"brand": "Brand", "brand": "Brand",
"power": "Power", "power": "Power",
"diameter": "Diameter", "diameter": "Diameter",
"remarks": "Remarks",
"activeMedications": "Active Medications", "activeMedications": "Active Medications",
"expDate": "Active Exp Date :", "expDate": "Active Exp Date :",
"route": "Route",
"frequency": "Frequency",
"dailyQuantity": "Daily Quantity :", "dailyQuantity": "Daily Quantity :",
"addReminder": "Add Reminder", "addReminder": "Add Reminder",
"cancelReminder": "Cancel Reminder", "cancelReminder": "Cancel Reminder",
@ -1428,5 +1425,70 @@
"overview": "Overview", "overview": "Overview",
"details": "Details", "details": "Details",
"healthy": "Healthy", "healthy": "Healthy",
"warning": "Warning" "warning": "Warning",
"vitalSignDetails": "Vital Sign Details",
"resultOf": "Result of {date}",
"resultOfNoDate": "Result of --",
"referenceRangeBetween": "Reference range: {low} {high} {unit}",
"referenceRangeMin": "Reference range: ≥ {low} {unit}",
"referenceRangeMax": "Reference range: ≤ {high} {unit}",
"noHistoryAvailable": "No history available",
"bmiDescription": "BMI is a measurement based on height and weight that estimates body fat.",
"heightDescription": "Height is measured in centimeters and is used to calculate BMI and dosage recommendations.",
"weightDescription": "Weight helps track overall health, nutrition, and changes over time.",
"bloodPressureDescription": "Blood pressure reflects the force of blood against artery walls. It is shown as systolic/diastolic.",
"temperatureDescription": "Body temperature reflects how hot your body is and may change with infection or inflammation.",
"heartRateDescriptionVital": "Heart rate refers to the number of heart beats per minute.",
"respiratoryRateDescription": "Respiratory rate is the number of breaths taken per minute.",
"bmiAdvice": "Maintain a balanced diet and regular activity. If your BMI is high or low, consider consulting your doctor.",
"heightAdvice": "No action is needed unless your measurement looks incorrect. Update it during your next visit.",
"weightAdvice": "Monitor weight changes. Sudden gain or loss may require medical advice.",
"bloodPressureAdvice": "Keep tracking your blood pressure. High or low readings should be discussed with your doctor.",
"temperatureAdvice": "If you have a persistent fever or symptoms, contact your healthcare provider.",
"heartRateAdvice": "Track your heart rate trends. If you feel dizziness or chest pain, seek medical care.",
"respiratoryRateAdvice": "If you notice shortness of breath or abnormal breathing, seek medical advice.",
"whatShouldIDoNext": "What should I do next?",
"customizeDrinkCup": "Customize your drink cup",
"tipsToStayHydrated": "Tips to stay hydrated",
"drinkBeforeYouFeelThirsty": "Drink before you feel thirsty",
"keepRefillableBottleNextToYou": "Keep a refillable bottle next to you",
"trackYourDailyIntakeToStayMotivated": "Track your daily intake to stay motivated",
"chooseSparklingWaterInsteadOfSoda": "Choose sparkling water instead of soda",
"switchCup": "Switch Cup",
"plainWater": "Plain Water",
"yourGoal": "Your Goal",
"remaining": "Remaining",
"hydrationStatus": "Hydration Status",
"areYouSureYouWantToCancelAllWaterReminders": "Are you sure you want to cancel all water reminders?",
"remindersSet": "Reminders Set!",
"dailyWaterRemindersScheduledAt": "Daily water reminders scheduled at:",
"waterConsumption": "Water Consumption",
"selectActivityLevel": "Select Activity Level",
"selectNumberOfReminders": "Select Number of Reminders",
"h2oSettings": "H20 Settings",
"settingsSavedSuccessfully": "Settings saved successfully",
"yourName": "Your Name",
"ageYears": "Age (11-120) yrs",
"numberOfRemindersInADay": "Number of reminders in a day",
"medications": "Medications",
"remarks": "Remarks: ",
"someRemarksAboutPrescription": "some remarks about the prescription will be here",
"notifyMeBeforeConsumptionTime": "Notify me before the consumption time",
"noMedicationsToday": "No medications today",
"route": "Route: {route}",
"frequency": "Frequency: {frequency}",
"instruction": "Instruction: {instruction}",
"duration": "Duration: {days}",
"reminders": "Reminders",
"reminderAddedToCalendar": "Reminder added to calendar ✅",
"errorWhileSettingCalendar": "Error while setting calendar: {error}",
"instructions": "Instructions",
"requests": "Requests",
"thisWeek": "This Week",
"lastMonth": "Last Month",
"lastSixMonths": "Last 6 Months",
"selectTime": "Select Time",
"pleaseWaitYouWillBeCalledForVitalSigns": "Please wait! you will be called for vital signs",
"pleaseVisitRoomForVitalSigns": "Please visit Room {roomNumber} for vital signs",
"pleaseVisitRoomToTheDoctor": "Please visit Room {roomNumber} to the Doctor"
} }

@ -959,11 +959,11 @@ class Utils {
static String getCardButtonText(int currentQueueStatus, String roomNumber) { static String getCardButtonText(int currentQueueStatus, String roomNumber) {
switch (currentQueueStatus) { switch (currentQueueStatus) {
case 0: case 0:
return "Please wait! you will be called for vital signs".needTranslation; return LocaleKeys.pleaseWaitYouWillBeCalledForVitalSigns.tr();
case 1: case 1:
return "Please visit Room $roomNumber for vital signs".needTranslation; return LocaleKeys.pleaseVisitRoomForVitalSigns.tr(namedArgs: {'roomNumber': roomNumber.toString()});
case 2: case 2:
return "Please visit Room $roomNumber to the Doctor".needTranslation; return LocaleKeys.pleaseVisitRoomToTheDoctor.tr(namedArgs: {'roomNumber': roomNumber.toString()});
} }
return ""; return "";
} }

@ -1430,5 +1430,63 @@ abstract class LocaleKeys {
static const details = 'details'; static const details = 'details';
static const healthy = 'healthy'; static const healthy = 'healthy';
static const warning = 'warning'; static const warning = 'warning';
static const vitalSignDetails = 'vitalSignDetails';
static const resultOfNoDate = 'resultOfNoDate';
static const referenceRangeBetween = 'referenceRangeBetween';
static const referenceRangeMin = 'referenceRangeMin';
static const referenceRangeMax = 'referenceRangeMax';
static const noHistoryAvailable = 'noHistoryAvailable';
static const bmiDescription = 'bmiDescription';
static const heightDescription = 'heightDescription';
static const weightDescription = 'weightDescription';
static const bloodPressureDescription = 'bloodPressureDescription';
static const temperatureDescription = 'temperatureDescription';
static const heartRateDescriptionVital = 'heartRateDescriptionVital';
static const respiratoryRateDescription = 'respiratoryRateDescription';
static const bmiAdvice = 'bmiAdvice';
static const heightAdvice = 'heightAdvice';
static const weightAdvice = 'weightAdvice';
static const bloodPressureAdvice = 'bloodPressureAdvice';
static const temperatureAdvice = 'temperatureAdvice';
static const heartRateAdvice = 'heartRateAdvice';
static const respiratoryRateAdvice = 'respiratoryRateAdvice';
static const whatShouldIDoNext = 'whatShouldIDoNext';
static const customizeDrinkCup = 'customizeDrinkCup';
static const tipsToStayHydrated = 'tipsToStayHydrated';
static const drinkBeforeYouFeelThirsty = 'drinkBeforeYouFeelThirsty';
static const keepRefillableBottleNextToYou = 'keepRefillableBottleNextToYou';
static const trackYourDailyIntakeToStayMotivated = 'trackYourDailyIntakeToStayMotivated';
static const chooseSparklingWaterInsteadOfSoda = 'chooseSparklingWaterInsteadOfSoda';
static const switchCup = 'switchCup';
static const plainWater = 'plainWater';
static const yourGoal = 'yourGoal';
static const remaining = 'remaining';
static const hydrationStatus = 'hydrationStatus';
static const areYouSureYouWantToCancelAllWaterReminders = 'areYouSureYouWantToCancelAllWaterReminders';
static const remindersSet = 'remindersSet';
static const dailyWaterRemindersScheduledAt = 'dailyWaterRemindersScheduledAt';
static const waterConsumption = 'waterConsumption';
static const selectNumberOfReminders = 'selectNumberOfReminders';
static const h2oSettings = 'h2oSettings';
static const settingsSavedSuccessfully = 'settingsSavedSuccessfully';
static const yourName = 'yourName';
static const ageYears = 'ageYears';
static const numberOfRemindersInADay = 'numberOfRemindersInADay';
static const medications = 'medications';
static const someRemarksAboutPrescription = 'someRemarksAboutPrescription';
static const notifyMeBeforeConsumptionTime = 'notifyMeBeforeConsumptionTime';
static const noMedicationsToday = 'noMedicationsToday';
static const reminders = 'reminders';
static const reminderAddedToCalendar = 'reminderAddedToCalendar';
static const errorWhileSettingCalendar = 'errorWhileSettingCalendar';
static const instructions = 'instructions';
static const requests = 'requests';
static const thisWeek = 'thisWeek';
static const lastMonth = 'lastMonth';
static const lastSixMonths = 'lastSixMonths';
static const selectTime = 'selectTime';
static const pleaseWaitYouWillBeCalledForVitalSigns = 'pleaseWaitYouWillBeCalledForVitalSigns';
static const pleaseVisitRoomForVitalSigns = 'pleaseVisitRoomForVitalSigns';
static const pleaseVisitRoomToTheDoctor = 'pleaseVisitRoomToTheDoctor';
} }

@ -134,7 +134,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text("Active Medications".needTranslation, Text(LocaleKeys.activeMedications.tr(),
style: TextStyle( style: TextStyle(
color: AppColors.textColor, color: AppColors.textColor,
fontSize: 27.f, fontSize: 27.f,
@ -191,7 +191,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
], ],
), ),
), ),
Text("Medications".needTranslation, Text(LocaleKeys.medications.tr(),
style: TextStyle( style: TextStyle(
color: AppColors.primaryRedBorderColor, color: AppColors.primaryRedBorderColor,
fontSize: 12.f, fontSize: 12.f,
@ -253,8 +253,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
text: TextSpan( text: TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: "Remarks: " text: LocaleKeys.remarks.tr(),
.needTranslation,
style: TextStyle( style: TextStyle(
color: color:
AppColors.textColor, AppColors.textColor,
@ -265,8 +264,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
), ),
TextSpan( TextSpan(
text: text:
"some remarks about the prescription will be here" LocaleKeys.someRemarksAboutPrescription.tr(),
.needTranslation,
style: TextStyle( style: TextStyle(
color: AppColors color: AppColors
.lightGreyTextColor, .lightGreyTextColor,
@ -312,8 +310,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Set Reminder" LocaleKeys.setReminder.tr(),
.needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 14.f, fontSize: 14.f,
fontWeight: fontWeight:
@ -321,8 +318,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
color: AppColors color: AppColors
.textColor)), .textColor)),
Text( Text(
"Notify me before the consumption time" LocaleKeys.notifyMeBeforeConsumptionTime.tr(),
.needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 12.f, fontSize: 12.f,
color: AppColors color: AppColors
@ -346,7 +342,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
: Utils.getNoDataWidget( : Utils.getNoDataWidget(
context, context,
noDataText: noDataText:
"No medications today".needTranslation, LocaleKeys.noMedicationsToday.tr(),
), ),
), ),
), ),
@ -397,17 +393,16 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
labelText: labelText:
"Route: ${med.route}".needTranslation), LocaleKeys.route.tr(namedArgs: {'route': med.route ?? ''})),
AppCustomChipWidget( AppCustomChipWidget(
labelText: labelText:
"Frequency: ${med.frequency}".needTranslation), LocaleKeys.frequency.tr(namedArgs: {'frequency': med.frequency ?? ''})),
AppCustomChipWidget( AppCustomChipWidget(
labelText: labelText:
"Daily Dose: ${med.doseDailyQuantity}" LocaleKeys.instruction.tr(namedArgs: {'instruction': med.doseDailyQuantity?.toString() ?? ''})),
.needTranslation),
AppCustomChipWidget( AppCustomChipWidget(
labelText: labelText:
"Duration: ${med.days}".needTranslation), LocaleKeys.duration.tr(namedArgs: {'days': med.days.toString() ?? ''})),
], ],
), ),
], ],
@ -419,7 +414,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
child: Row(children: [ child: Row(children: [
Expanded( Expanded(
child: CustomButton( child: CustomButton(
text: "Check Availability".needTranslation, text: LocaleKeys.checkAvailability.tr(),
fontSize: 13.f, fontSize: 13.f,
onPressed: () {}, onPressed: () {},
backgroundColor: AppColors.secondaryLightRedColor, backgroundColor: AppColors.secondaryLightRedColor,
@ -430,7 +425,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
SizedBox(width: 12.h), SizedBox(width: 12.h),
Expanded( Expanded(
child: CustomButton( child: CustomButton(
text: "Read Instructions".needTranslation, text: LocaleKeys.readInstructions.tr(),
fontSize: 13.f, fontSize: 13.f,
onPressed: () {})), onPressed: () {})),
]), ]),
@ -519,7 +514,7 @@ class _ActiveMedicationPageState extends State<ActiveMedicationPage> {
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
"Reminders".needTranslation, LocaleKeys.reminders.tr(),
style: TextStyle( style: TextStyle(
fontSize: 20.f, fontSize: 20.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -988,11 +983,11 @@ class _ReminderTimerDialogState extends State<ReminderTimerDialog> {
route: widget.med.route ?? "", route: widget.med.route ?? "",
); );
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Reminder added to calendar ✅".needTranslation)), SnackBar(content: Text(LocaleKeys.reminderAddedToCalendar.tr())),
); );
} catch (e) { } catch (e) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Error while setting calendar: $e".needTranslation)), SnackBar(content: Text(LocaleKeys.errorWhileSettingCalendar.tr(namedArgs: {'error': e.toString()}))),
); );
} }
Navigator.pop(context); Navigator.pop(context);

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -9,6 +10,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/hmg_services_view_model.dart';
import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/vital_sign_respo_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/vital_sign_respo_model.dart';
import 'package:hmg_patient_app_new/features/hmg_services/models/ui_models/vital_sign_ui_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/ui_models/vital_sign_ui_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/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/graph/custom_graph.dart'; import 'package:hmg_patient_app_new/widgets/graph/custom_graph.dart';
@ -62,7 +64,7 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CollapsingListView( return CollapsingListView(
title: 'Vital Sign Details'.needTranslation, title: LocaleKeys.vitalSignDetails.tr(context: context),
child: Consumer<HmgServicesViewModel>( child: Consumer<HmgServicesViewModel>(
builder: (context, viewModel, child) { builder: (context, viewModel, child) {
final latest = viewModel.vitalSignList.isNotEmpty ? viewModel.vitalSignList.first : null; final latest = viewModel.vitalSignList.isNotEmpty ? viewModel.vitalSignList.first : null;
@ -128,8 +130,8 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
(latestDate != null (latestDate != null
? ('Result of ${latestDate.toString().split(' ').first}'.needTranslation) ? LocaleKeys.resultOf.tr(namedArgs: {'date': latestDate.toString().split(' ').first})
: ('Result of --'.needTranslation)) : LocaleKeys.resultOfNoDate.tr(context: context))
.toText11(weight: FontWeight.w500, color: AppColors.greyTextColor), .toText11(weight: FontWeight.w500, color: AppColors.greyTextColor),
], ],
), ),
@ -185,13 +187,23 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
String _referenceText(BuildContext context) { String _referenceText(BuildContext context) {
if (args.low != null && args.high != null) { if (args.low != null && args.high != null) {
return 'Reference range: ${args.low} ${args.high} ${args.unit}'.needTranslation; return LocaleKeys.referenceRangeBetween.tr(namedArgs: {
'low': args.low.toString(),
'high': args.high.toString(),
'unit': args.unit ?? ''
});
} }
if (args.low != null) { if (args.low != null) {
return 'Reference range: ≥ ${args.low} ${args.unit}'.needTranslation; return LocaleKeys.referenceRangeMin.tr(namedArgs: {
'low': args.low.toString(),
'unit': args.unit ?? ''
});
} }
if (args.high != null) { if (args.high != null) {
return 'Reference range: ≤ ${args.high} ${args.unit}'.needTranslation; return LocaleKeys.referenceRangeMax.tr(namedArgs: {
'high': args.high.toString(),
'unit': args.unit ?? ''
});
} }
return ''; return '';
} }
@ -208,7 +220,7 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8.h, spacing: 8.h,
children: [ children: [
'What is this result?'.needTranslation.toText16(weight: FontWeight.w600, color: AppColors.textColor), LocaleKeys.whatIsThisResult.tr(context: context).toText16(weight: FontWeight.w600, color: AppColors.textColor),
_descriptionText(context).toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), _descriptionText(context).toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
], ],
), ),
@ -243,7 +255,7 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
_isGraphVisible ? 'History flowchart'.needTranslation : 'History'.needTranslation, _isGraphVisible ? LocaleKeys.historyFlowchart.tr(context: context) : LocaleKeys.history.tr(context: context),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -288,7 +300,7 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
).paddingOnly(bottom: _isGraphVisible ? 16.h : 24.h), ).paddingOnly(bottom: _isGraphVisible ? 16.h : 24.h),
if (history.isEmpty) if (history.isEmpty)
Utils.getNoDataWidget(context, noDataText: 'No history available'.needTranslation, isSmallWidget: true) Utils.getNoDataWidget(context, noDataText: LocaleKeys.noHistoryAvailable.tr(context: context), isSmallWidget: true)
else if (_isGraphVisible) else if (_isGraphVisible)
_buildHistoryGraph(history, secondaryHistory: secondaryHistory) _buildHistoryGraph(history, secondaryHistory: secondaryHistory)
else else
@ -649,38 +661,38 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
String _descriptionText(BuildContext context) { String _descriptionText(BuildContext context) {
switch (args.metric) { switch (args.metric) {
case VitalSignMetric.bmi: case VitalSignMetric.bmi:
return 'BMI is a measurement based on height and weight that estimates body fat.'.needTranslation; return LocaleKeys.bmiDescription.tr(context: context);
case VitalSignMetric.height: case VitalSignMetric.height:
return 'Height is measured in centimeters and is used to calculate BMI and dosage recommendations.'.needTranslation; return LocaleKeys.heightDescription.tr(context: context);
case VitalSignMetric.weight: case VitalSignMetric.weight:
return 'Weight helps track overall health, nutrition, and changes over time.'.needTranslation; return LocaleKeys.weightDescription.tr(context: context);
case VitalSignMetric.bloodPressure: case VitalSignMetric.bloodPressure:
return 'Blood pressure reflects the force of blood against artery walls. It is shown as systolic/diastolic.'.needTranslation; return LocaleKeys.bloodPressureDescription.tr(context: context);
case VitalSignMetric.temperature: case VitalSignMetric.temperature:
return 'Body temperature reflects how hot your body is and may change with infection or inflammation.'.needTranslation; return LocaleKeys.temperatureDescription.tr(context: context);
case VitalSignMetric.heartRate: case VitalSignMetric.heartRate:
return 'Heart rate refers to the number of heart beats per minute.'.needTranslation; return LocaleKeys.heartRateDescriptionVital.tr(context: context);
case VitalSignMetric.respiratoryRate: case VitalSignMetric.respiratoryRate:
return 'Respiratory rate is the number of breaths taken per minute.'.needTranslation; return LocaleKeys.respiratoryRateDescription.tr(context: context);
} }
} }
String _nextStepsText(BuildContext context) { String _nextStepsText(BuildContext context) {
switch (args.metric) { switch (args.metric) {
case VitalSignMetric.bmi: case VitalSignMetric.bmi:
return 'Maintain a balanced diet and regular activity. If your BMI is high or low, consider consulting your doctor.'.needTranslation; return LocaleKeys.bmiAdvice.tr(context: context);
case VitalSignMetric.height: case VitalSignMetric.height:
return 'No action is needed unless your measurement looks incorrect. Update it during your next visit.'.needTranslation; return LocaleKeys.heightAdvice.tr(context: context);
case VitalSignMetric.weight: case VitalSignMetric.weight:
return 'Monitor weight changes. Sudden gain or loss may require medical advice.'.needTranslation; return LocaleKeys.weightAdvice.tr(context: context);
case VitalSignMetric.bloodPressure: case VitalSignMetric.bloodPressure:
return 'Keep tracking your blood pressure. High or low readings should be discussed with your doctor.'.needTranslation; return LocaleKeys.bloodPressureAdvice.tr(context: context);
case VitalSignMetric.temperature: case VitalSignMetric.temperature:
return 'If you have a persistent fever or symptoms, contact your healthcare provider.'.needTranslation; return LocaleKeys.temperatureAdvice.tr(context: context);
case VitalSignMetric.heartRate: case VitalSignMetric.heartRate:
return 'Track your heart rate trends. If you feel dizziness or chest pain, seek medical care.'.needTranslation; return LocaleKeys.heartRateAdvice.tr(context: context);
case VitalSignMetric.respiratoryRate: case VitalSignMetric.respiratoryRate:
return 'If you notice shortness of breath or abnormal breathing, seek medical advice.'.needTranslation; return LocaleKeys.respiratoryRateAdvice.tr(context: context);
} }
} }
@ -695,7 +707,7 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'What should I do next?'.needTranslation.toText16(weight: FontWeight.w600), LocaleKeys.whatShouldIDoNext.tr(context: context).toText16(weight: FontWeight.w600),
SizedBox(height: 8.h), SizedBox(height: 8.h),
_nextStepsText(context).toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500, maxLine: 10), _nextStepsText(context).toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500, maxLine: 10),
], ],

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart'; import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/hydration_tips_widget.dart'; import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/hydration_tips_widget.dart';
import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/water_intake_summary_widget.dart'; import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/water_intake_summary_widget.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart';
@ -100,7 +102,7 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
children: [ children: [
Row( Row(
children: [ children: [
"History".needTranslation.toText16(isBold: true), LocaleKeys.history.tr(context: context).toText16(isBold: true),
SizedBox(width: 8.w), SizedBox(width: 8.w),
InkWell( InkWell(
onTap: () => _showHistoryDurationBottomsheet(context, viewModel), onTap: () => _showHistoryDurationBottomsheet(context, viewModel),
@ -604,7 +606,7 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
final dialogService = getIt.get<DialogService>(); final dialogService = getIt.get<DialogService>();
dialogService.showFamilyBottomSheetWithoutHWithChild( dialogService.showFamilyBottomSheetWithoutHWithChild(
label: title.needTranslation, label: title,
message: "", message: "",
child: Container( child: Container(
padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h),
@ -634,7 +636,7 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
void _showHistoryDurationBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) { void _showHistoryDurationBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) {
_showSelectionBottomSheet( _showSelectionBottomSheet(
context: context, context: context,
title: "Select Duration".needTranslation, title: LocaleKeys.selectDuration.tr(context: context),
items: viewModel.durationFilters, items: viewModel.durationFilters,
selectedValue: viewModel.selectedDurationFilter, selectedValue: viewModel.selectedDurationFilter,
onSelected: viewModel.setFilterDuration, onSelected: viewModel.setFilterDuration,
@ -655,10 +657,10 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
/// Show confirmation bottom sheet before cancelling reminders /// Show confirmation bottom sheet before cancelling reminders
void _showCancelReminderConfirmation(WaterMonitorViewModel viewModel) { void _showCancelReminderConfirmation(WaterMonitorViewModel viewModel) {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: 'Notice'.needTranslation, title: LocaleKeys.notice.tr(context: context),
context, context,
child: Utils.getWarningWidget( child: Utils.getWarningWidget(
loadingText: "Are you sure you want to cancel all water reminders?".needTranslation, loadingText: LocaleKeys.areYouSureYouWantToCancelAllWaterReminders.tr(context: context),
isShowActionButtons: true, isShowActionButtons: true,
onCancelTap: () { onCancelTap: () {
Navigator.pop(context); Navigator.pop(context);
@ -694,7 +696,7 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
/// Show bottom sheet with scheduled reminder times /// Show bottom sheet with scheduled reminder times
void _showReminderScheduledDialog(List<DateTime> times) { void _showReminderScheduledDialog(List<DateTime> times) {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: 'Reminders Set!'.needTranslation, title: LocaleKeys.remindersSet.tr(context: context),
context, context,
isCloseButtonVisible: false, isCloseButtonVisible: false,
isDismissible: false, isDismissible: false,
@ -703,7 +705,7 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Utils.getSuccessWidget(loadingText: 'Daily water reminders scheduled at:'.needTranslation), Utils.getSuccessWidget(loadingText: LocaleKeys.dailyWaterRemindersScheduledAt.tr(context: context)),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Wrap( Wrap(
spacing: 8.w, spacing: 8.w,
@ -728,7 +730,7 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
Expanded( Expanded(
child: CustomButton( child: CustomButton(
height: 56.h, height: 56.h,
text: 'OK'.needTranslation, text: LocaleKeys.ok.tr(context: context),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
), ),
@ -792,7 +794,7 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
body: CollapsingListView( body: CollapsingListView(
title: "Water Consumption".needTranslation, title: LocaleKeys.waterConsumption.tr(context: context),
bottomChild: Consumer<WaterMonitorViewModel>( bottomChild: Consumer<WaterMonitorViewModel>(
builder: (context, viewModel, child) { builder: (context, viewModel, child) {
return Container( return Container(
@ -804,7 +806,7 @@ class _WaterConsumptionPageState extends State<WaterConsumptionPage> {
child: Padding( child: Padding(
padding: EdgeInsets.all(24.w), padding: EdgeInsets.all(24.w),
child: CustomButton( child: CustomButton(
text: viewModel.isWaterReminderEnabled ? "Cancel Reminders".needTranslation : "Set Reminder".needTranslation, text: viewModel.isWaterReminderEnabled ? LocaleKeys.cancelReminder.tr(context: context) : LocaleKeys.setReminder.tr(context: context),
textColor: viewModel.isWaterReminderEnabled ? AppColors.errorColor : AppColors.successColor, textColor: viewModel.isWaterReminderEnabled ? AppColors.errorColor : AppColors.successColor,
backgroundColor: viewModel.isWaterReminderEnabled ? AppColors.errorColor.withValues(alpha: 0.1) : AppColors.successLightBgColor, backgroundColor: viewModel.isWaterReminderEnabled ? AppColors.errorColor.withValues(alpha: 0.1) : AppColors.successLightBgColor,
onPressed: () => _handleReminderButtonTap(viewModel), onPressed: () => _handleReminderButtonTap(viewModel),

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/app_export.dart';
@ -6,6 +7,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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart'; import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_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/services/dialog_service.dart';
import 'package:hmg_patient_app_new/theme/colors.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/appbar/collapsing_list_view.dart';
@ -69,7 +71,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
bool useUpperCase = false, bool useUpperCase = false,
}) { }) {
dialogService.showFamilyBottomSheetWithoutHWithChild( dialogService.showFamilyBottomSheetWithoutHWithChild(
label: title.needTranslation, label: title,
message: "", message: "",
child: Container( child: Container(
padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h),
@ -99,7 +101,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
void _showGenderSelectionBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) { void _showGenderSelectionBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) {
_showSelectionBottomSheet( _showSelectionBottomSheet(
context: context, context: context,
title: "Select Gender".needTranslation, title: LocaleKeys.selectGender.tr(context: context),
items: viewModel.genderOptions, items: viewModel.genderOptions,
selectedValue: viewModel.selectedGender, selectedValue: viewModel.selectedGender,
onSelected: viewModel.setGender, onSelected: viewModel.setGender,
@ -109,7 +111,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
void _showHeightUnitSelectionBottomSheet(BuildContext context, WaterMonitorViewModel viewModel) { void _showHeightUnitSelectionBottomSheet(BuildContext context, WaterMonitorViewModel viewModel) {
_showSelectionBottomSheet( _showSelectionBottomSheet(
context: context, context: context,
title: "Select Unit".needTranslation, title: LocaleKeys.selectUnit.tr(context: context),
items: viewModel.heightUnits, items: viewModel.heightUnits,
selectedValue: viewModel.selectedHeightUnit, selectedValue: viewModel.selectedHeightUnit,
onSelected: viewModel.setHeightUnit, onSelected: viewModel.setHeightUnit,
@ -120,7 +122,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
void _showWeightUnitSelectionBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) { void _showWeightUnitSelectionBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) {
_showSelectionBottomSheet( _showSelectionBottomSheet(
context: context, context: context,
title: "Select Unit".needTranslation, title: LocaleKeys.selectUnit.tr(context: context),
items: viewModel.weightUnits, items: viewModel.weightUnits,
selectedValue: viewModel.selectedWeightUnit, selectedValue: viewModel.selectedWeightUnit,
onSelected: viewModel.setWeightUnit, onSelected: viewModel.setWeightUnit,
@ -131,7 +133,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
void _showActivityLevelSelectionBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) { void _showActivityLevelSelectionBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) {
_showSelectionBottomSheet( _showSelectionBottomSheet(
context: context, context: context,
title: "Select Activity Level".needTranslation, title: LocaleKeys.selectActivityLevel.tr(context: context),
items: viewModel.activityLevels, items: viewModel.activityLevels,
selectedValue: viewModel.selectedActivityLevel, selectedValue: viewModel.selectedActivityLevel,
onSelected: viewModel.setActivityLevel, onSelected: viewModel.setActivityLevel,
@ -141,7 +143,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
void _showNumberOfRemindersSelectionBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) { void _showNumberOfRemindersSelectionBottomsheet(BuildContext context, WaterMonitorViewModel viewModel) {
_showSelectionBottomSheet( _showSelectionBottomSheet(
context: context, context: context,
title: "Select Number of Reminders".needTranslation, title: LocaleKeys.selectNumberOfReminders.tr(context: context),
items: viewModel.reminderOptions, items: viewModel.reminderOptions,
selectedValue: viewModel.selectedNumberOfReminders, selectedValue: viewModel.selectedNumberOfReminders,
onSelected: viewModel.setNumberOfReminders, onSelected: viewModel.setNumberOfReminders,
@ -256,7 +258,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
body: CollapsingListView( body: CollapsingListView(
title: "H20 Settings".needTranslation, title: LocaleKeys.h2oSettings.tr(context: context),
bottomChild: Container( bottomChild: Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
@ -266,7 +268,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
child: Padding( child: Padding(
padding: EdgeInsets.all(24.w), padding: EdgeInsets.all(24.w),
child: CustomButton( child: CustomButton(
text: "Save".needTranslation, text: LocaleKeys.save.tr(context: context),
onPressed: () async { onPressed: () async {
final success = await viewModel.saveSettings(); final success = await viewModel.saveSettings();
if (!success && viewModel.validationError != null) { if (!success && viewModel.validationError != null) {
@ -277,7 +279,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
child: Utils.getSuccessWidget( child: Utils.getSuccessWidget(
loadingText: "Settings saved successfully".needTranslation, loadingText: LocaleKeys.settingsSavedSuccessfully.tr(context: context),
), ),
callBackFunc: () {}, callBackFunc: () {},
isCloseButtonVisible: false, isCloseButtonVisible: false,
@ -299,18 +301,18 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
children: [ children: [
_buildSettingsRow( _buildSettingsRow(
icon: AppAssets.profileIcon, icon: AppAssets.profileIcon,
label: "Your Name".needTranslation, label: LocaleKeys.yourName.tr(context: context),
inputField: _buildTextField(viewModel.nameController, 'Guest'), inputField: _buildTextField(viewModel.nameController, 'Guest'),
), ),
_buildSettingsRow( _buildSettingsRow(
icon: AppAssets.genderIcon, icon: AppAssets.genderIcon,
label: "Select Gender".needTranslation, label: LocaleKeys.selectGender.tr(context: context),
value: viewModel.selectedGender, value: viewModel.selectedGender,
onRowTap: () => _showGenderSelectionBottomsheet(context, viewModel), onRowTap: () => _showGenderSelectionBottomsheet(context, viewModel),
), ),
_buildSettingsRow( _buildSettingsRow(
icon: AppAssets.calendarGrey, icon: AppAssets.calendarGrey,
label: "Age (11-120) yrs".needTranslation, label: LocaleKeys.ageYears.tr(context: context),
inputField: _buildTextField( inputField: _buildTextField(
viewModel.ageController, viewModel.ageController,
'20', '20',
@ -319,7 +321,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
), ),
_buildSettingsRow( _buildSettingsRow(
icon: AppAssets.heightIcon, icon: AppAssets.heightIcon,
label: "Height".needTranslation, label: LocaleKeys.height.tr(context: context),
inputField: _buildTextField( inputField: _buildTextField(
viewModel.heightController, viewModel.heightController,
'175', '175',
@ -330,7 +332,7 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
), ),
_buildSettingsRow( _buildSettingsRow(
icon: AppAssets.weightScaleIcon, icon: AppAssets.weightScaleIcon,
label: "Weight".needTranslation, label: LocaleKeys.weight.tr(context: context),
inputField: _buildTextField( inputField: _buildTextField(
viewModel.weightController, viewModel.weightController,
'75', '75',
@ -341,13 +343,13 @@ class _WaterMonitorSettingsPageState extends State<WaterMonitorSettingsPage> {
), ),
_buildSettingsRow( _buildSettingsRow(
icon: AppAssets.dumbellIcon, icon: AppAssets.dumbellIcon,
label: "Activity Level".needTranslation, label: LocaleKeys.activityLevel.tr(context: context),
value: viewModel.selectedActivityLevel, value: viewModel.selectedActivityLevel,
onRowTap: () => _showActivityLevelSelectionBottomsheet(context, viewModel), onRowTap: () => _showActivityLevelSelectionBottomsheet(context, viewModel),
), ),
_buildSettingsRow( _buildSettingsRow(
icon: AppAssets.notificationIconGrey, icon: AppAssets.notificationIconGrey,
label: "Number of reminders in a day".needTranslation, label: LocaleKeys.numberOfRemindersInADay.tr(context: context),
value: viewModel.selectedNumberOfReminders, value: viewModel.selectedNumberOfReminders,
onRowTap: () => _showNumberOfRemindersSelectionBottomsheet(context, viewModel), onRowTap: () => _showNumberOfRemindersSelectionBottomsheet(context, viewModel),
showDivider: false, showDivider: false,

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/app_export.dart';
@ -7,6 +8,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/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/water_monitor/models/water_cup_model.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_view_model.dart'; import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_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:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
@ -143,7 +145,7 @@ class SwitchCupBottomSheet extends StatelessWidget {
child: Center(child: Utils.buildSvgWithAssets(icon: AppAssets.cupAdd, height: 30.h, width: 42.w)), child: Center(child: Utils.buildSvgWithAssets(icon: AppAssets.cupAdd, height: 30.h, width: 42.w)),
), ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
'Add'.needTranslation.toText10(weight: FontWeight.w500), LocaleKeys.add.tr(context: context).toText10(weight: FontWeight.w500),
], ],
), ),
); );
@ -157,7 +159,7 @@ void showCustomizeCupBottomSheet(BuildContext context, {WaterCupModel? cupToEdit
titleWidget: Column( titleWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Customize your drink cup".needTranslation.toText20(weight: FontWeight.w600), LocaleKeys.customizeDrinkCup.tr(context: context).toText20(weight: FontWeight.w600),
], ],
), ),
child: CustomizeCupBottomSheet(cupToEdit: cupToEdit), child: CustomizeCupBottomSheet(cupToEdit: cupToEdit),
@ -294,7 +296,7 @@ class _CustomizeCupBottomSheetState extends State<CustomizeCupBottomSheet> {
SizedBox(height: 24.h), SizedBox(height: 24.h),
CustomButton( CustomButton(
text: 'Select'.needTranslation, text: LocaleKeys.select.tr(context: context),
onPressed: () { onPressed: () {
final newCup = WaterCupModel( final newCup = WaterCupModel(
id: widget.cupToEdit?.id ?? Uuid().v4(), id: widget.cupToEdit?.id ?? Uuid().v4(),

@ -1,9 +1,11 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/app_export.dart';
import 'package:hmg_patient_app_new/core/utils/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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_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'; import 'package:hmg_patient_app_new/theme/colors.dart';
class HydrationTipsWidget extends StatelessWidget { class HydrationTipsWidget extends StatelessWidget {
@ -30,26 +32,26 @@ class HydrationTipsWidget extends StatelessWidget {
height: 24.h, height: 24.h,
), ),
SizedBox(width: 8.w), SizedBox(width: 8.w),
"Tips to stay hydrated".needTranslation.toText16(isBold: true), LocaleKeys.tipsToStayHydrated.tr(context: context).toText16(isBold: true),
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
"${"Drink before you feel thirsty"}".needTranslation.toText12( "${LocaleKeys.drinkBeforeYouFeelThirsty.tr(context: context)}".toText12(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.textColorLight, color: AppColors.textColorLight,
), ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"${"Keep a refillable bottle next to you"}".needTranslation.toText12( "${LocaleKeys.keepRefillableBottleNextToYou.tr(context: context)}".toText12(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.textColorLight, color: AppColors.textColorLight,
), ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"${"Track your daily intake to stay motivated"}".needTranslation.toText12( "${LocaleKeys.trackYourDailyIntakeToStayMotivated.tr(context: context)}".toText12(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.textColorLight, color: AppColors.textColorLight,
), ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"${"Choose sparkling water instead of soda"}".needTranslation.toText12( "${LocaleKeys.chooseSparklingWaterInsteadOfSoda.tr(context: context)}".toText12(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.textColorLight, color: AppColors.textColorLight,
), ),

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/app_export.dart';
@ -6,6 +7,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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart'; import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/cup_bottomsheet_widgets.dart'; import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/cup_bottomsheet_widgets.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -83,19 +85,19 @@ class WaterActionButtonsWidget extends StatelessWidget {
context: context, context: context,
onTap: () => showSwitchCupBottomSheet(context), onTap: () => showSwitchCupBottomSheet(context),
overlayWidget: AppAssets.refreshIcon, overlayWidget: AppAssets.refreshIcon,
title: "Switch Cup".needTranslation, title: LocaleKeys.switchCup.tr(context: context),
icon: Utils.buildSvgWithAssets(icon: AppAssets.glassIcon, height: 24.w, width: 24.w), icon: Utils.buildSvgWithAssets(icon: AppAssets.glassIcon, height: 24.w, width: 24.w),
), ),
_buildActionButton( _buildActionButton(
context: context, context: context,
onTap: () async {}, onTap: () async {},
title: "Plain Water".needTranslation, title: LocaleKeys.plainWater.tr(context: context),
icon: Utils.buildSvgWithAssets(icon: AppAssets.glassIcon, height: 24.w, width: 24.w), icon: Utils.buildSvgWithAssets(icon: AppAssets.glassIcon, height: 24.w, width: 24.w),
), ),
_buildActionButton( _buildActionButton(
context: context, context: context,
onTap: () => context.navigateWithName(AppRoutes.waterMonitorSettingsPage), onTap: () => context.navigateWithName(AppRoutes.waterMonitorSettingsPage),
title: "Settings".needTranslation, title: LocaleKeys.settings.tr(context: context),
icon: Icon( icon: Icon(
Icons.settings, Icons.settings,
color: AppColors.blueColor, color: AppColors.blueColor,

@ -1,7 +1,9 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_export.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/string_extensions.dart';
import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart'; import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/water_action_buttons_widget.dart'; import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/water_action_buttons_widget.dart';
import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/water_bottle_widget.dart'; import 'package:hmg_patient_app_new/presentation/water_monitor/widgets/water_bottle_widget.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
@ -51,7 +53,6 @@ class WaterIntakeSummaryWidget extends StatelessWidget {
if (!vm.nextDrinkTime.toLowerCase().contains('goal achieved')) if (!vm.nextDrinkTime.toLowerCase().contains('goal achieved'))
// Show "Tomorrow" if nextDrinkTime contains "tomorrow", otherwise "Next Drink Time" // Show "Tomorrow" if nextDrinkTime contains "tomorrow", otherwise "Next Drink Time"
(vm.nextDrinkTime.toLowerCase().contains('tomorrow') ? "Tomorrow" : "Next Drink Time") (vm.nextDrinkTime.toLowerCase().contains('tomorrow') ? "Tomorrow" : "Next Drink Time")
.needTranslation
.toText18(weight: FontWeight.w600, color: AppColors.textColor), .toText18(weight: FontWeight.w600, color: AppColors.textColor),
// Extract only time if "tomorrow" is present, otherwise show as is // Extract only time if "tomorrow" is present, otherwise show as is
@ -61,14 +62,17 @@ class WaterIntakeSummaryWidget extends StatelessWidget {
.toText32(weight: FontWeight.w600, color: AppColors.blueColor), .toText32(weight: FontWeight.w600, color: AppColors.blueColor),
SizedBox(height: 12.h), SizedBox(height: 12.h),
_buildStatusColumn(title: "Your Goal".needTranslation, subTitle: "${goalMl}ml"), Row(
SizedBox(height: 8.h), children: [
_buildStatusColumn(title: "Remaining".needTranslation, subTitle: "${remaining}ml"), _buildStatusColumn(title: LocaleKeys.yourGoal.tr(context: context), subTitle: "${goalMl}ml"),
SizedBox(height: 8.h), SizedBox(width: 16.w),
_buildStatusColumn(title: "Completed".needTranslation, subTitle: completedPercent, subTitleColor: AppColors.successColor), _buildStatusColumn(title: LocaleKeys.remaining.tr(context: context), subTitle: "${remaining}ml"),
SizedBox(height: 8.h), SizedBox(width: 16.w),
_buildStatusColumn(title: LocaleKeys.completed.tr(context: context), subTitle: completedPercent, subTitleColor: AppColors.successColor),
],
),
_buildStatusColumn( _buildStatusColumn(
title: "Hydration Status".needTranslation, title: LocaleKeys.hydrationStatus.tr(context: context),
subTitle: vm.hydrationStatus, subTitle: vm.hydrationStatus,
subTitleColor: vm.hydrationStatusColor, subTitleColor: vm.hydrationStatusColor,
), ),

@ -41,9 +41,9 @@ class _AppLanguageChangeState extends State<AppLanguageChange> {
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: Column( child: Column(
children: [ children: [
languageItem("English".needTranslation, "en"), languageItem("English", "en"),
1.divider, 1.divider,
languageItem("العربية".needTranslation, "ar"), languageItem("العربية", "ar"),
], ],
), ),
), ),

@ -1,4 +1,5 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -8,6 +9,7 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/route_extensions.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/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_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'; import 'package:hmg_patient_app_new/theme/colors.dart';
import '../../core/dependencies.dart'; import '../../core/dependencies.dart';
@ -250,7 +252,7 @@ class _ScrollAnimatedTitleState extends State<ScrollAnimatedTitle> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final isRtl = Directionality.of(context) == TextDirection.rtl; final isRtl = Directionality.of(context) == TextDirection.RTL;
return Container( return Container(
height: (widget.preferredSize.height - _fontSize / 2).h, height: (widget.preferredSize.height - _fontSize / 2).h,
alignment: isRtl ? (widget.showBack ? Alignment.topRight : Alignment.centerRight) : (widget.showBack ? Alignment.topLeft : Alignment.centerLeft), alignment: isRtl ? (widget.showBack ? Alignment.topRight : Alignment.centerRight) : (widget.showBack ? Alignment.topLeft : Alignment.centerLeft),
@ -269,12 +271,12 @@ class _ScrollAnimatedTitleState extends State<ScrollAnimatedTitle> {
), ),
).expanded, ).expanded,
...[ ...[
if (widget.logout != null) actionButton(context, t, title: "Logout".needTranslation, icon: AppAssets.logout).onPress(widget.logout!), if (widget.logout != null) actionButton(context, t, title: LocaleKeys.logout.tr(context: context), icon: AppAssets.logout).onPress(widget.logout!),
if (widget.report != null) actionButton(context, t, title: "Feedback".needTranslation, icon: AppAssets.report_icon).onPress(widget.report!), if (widget.report != null) actionButton(context, t, title: LocaleKeys.feedback.tr(context: context), icon: AppAssets.report_icon).onPress(widget.report!),
if (widget.history != null) actionButton(context, t, title: "History".needTranslation, icon: AppAssets.insurance_history_icon).onPress(widget.history!), if (widget.history != null) actionButton(context, t, title: LocaleKeys.history.tr(context: context), icon: AppAssets.insurance_history_icon).onPress(widget.history!),
if (widget.instructions != null) actionButton(context, t, title: "Instructions".needTranslation, icon: AppAssets.requests).onPress(widget.instructions!), if (widget.instructions != null) actionButton(context, t, title: LocaleKeys.instructions.tr(context: context), icon: AppAssets.requests).onPress(widget.instructions!),
if (widget.requests != null) actionButton(context, t, title: "Requests".needTranslation, icon: AppAssets.insurance_history_icon).onPress(widget.requests!), if (widget.requests != null) actionButton(context, t, title: LocaleKeys.requests.tr(context: context), icon: AppAssets.insurance_history_icon).onPress(widget.requests!),
if (widget.sendEmail != null) actionButton(context, t, title: "Send Email".needTranslation, icon: AppAssets.email).onPress(widget.sendEmail!), if (widget.sendEmail != null) actionButton(context, t, title: LocaleKeys.sendEmail.tr(context: context), icon: AppAssets.email).onPress(widget.sendEmail!),
if (widget.search != null) Utils.buildSvgWithAssets(icon: AppAssets.search_icon).onPress(widget.search!), if (widget.search != null) Utils.buildSvgWithAssets(icon: AppAssets.search_icon).onPress(widget.search!),
if (widget.trailing != null) widget.trailing!, if (widget.trailing != null) widget.trailing!,
] ]

@ -1,5 +1,6 @@
import 'dart:ui'; import 'dart:ui';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -8,6 +9,7 @@ import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/utils/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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_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'; import 'package:hmg_patient_app_new/theme/colors.dart';
import '../../core/dependencies.dart'; import '../../core/dependencies.dart';
@ -140,11 +142,11 @@ class _CollapsingToolbarState extends State<CollapsingToolbar> {
color: AppColors.blackColor, color: AppColors.blackColor,
letterSpacing: -0.5), letterSpacing: -0.5),
).expanded, ).expanded,
if (widget.logout != null) actionButton(context, t, title: "Logout".needTranslation, icon: AppAssets.logout).onPress(widget.logout!), if (widget.logout != null) actionButton(context, t, title: LocaleKeys.logout.tr(context: context), icon: AppAssets.logout).onPress(widget.logout!),
if (widget.report != null) actionButton(context, t, title: "Report".needTranslation, icon: AppAssets.report_icon).onPress(widget.report!), if (widget.report != null) actionButton(context, t, title: LocaleKeys.report.tr(context: context), icon: AppAssets.report_icon).onPress(widget.report!),
if (widget.history != null) actionButton(context, t, title: "History".needTranslation, icon: AppAssets.insurance_history_icon).onPress(widget.history!), if (widget.history != null) actionButton(context, t, title: LocaleKeys.history.tr(context: context), icon: AppAssets.insurance_history_icon).onPress(widget.history!),
if (widget.instructions != null) actionButton(context, t, title: "Instructions".needTranslation, icon: AppAssets.requests).onPress(widget.instructions!), if (widget.instructions != null) actionButton(context, t, title: LocaleKeys.instructions.tr(context: context), icon: AppAssets.requests).onPress(widget.instructions!),
if (widget.requests != null) actionButton(context, t, title: "Requests".needTranslation, icon: AppAssets.insurance_history_icon).onPress(widget.requests!), if (widget.requests != null) actionButton(context, t, title: LocaleKeys.requests.tr(context: context), icon: AppAssets.insurance_history_icon).onPress(widget.requests!),
if (widget.search != null) Utils.buildSvgWithAssets(icon: AppAssets.search_icon).onPress(widget.search!).paddingOnly(right: 24), if (widget.search != null) Utils.buildSvgWithAssets(icon: AppAssets.search_icon).onPress(widget.search!).paddingOnly(right: 24),
if (widget.trailing != null) widget.trailing!, if (widget.trailing != null) widget.trailing!,
], ],

@ -71,7 +71,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
children: [ children: [
fromDateComponent(), fromDateComponent(),
Text( Text(
LocaleKeys.to.tr(), LocaleKeys.to.tr(context: context),
style: TextStyle( style: TextStyle(
color: AppColors.calenderTextColor, color: AppColors.calenderTextColor,
fontSize: 14.h, fontSize: 14.h,
@ -168,7 +168,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
children: [ children: [
Expanded( Expanded(
child: CustomButton( child: CustomButton(
text: LocaleKeys.cancel.tr(), text: LocaleKeys.cancel.tr(context: context),
onPressed: () { onPressed: () {
_calendarController.selectedRange = null; _calendarController.selectedRange = null;
_calendarController.selectedDate = null; _calendarController.selectedDate = null;
@ -192,7 +192,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
), ),
Expanded( Expanded(
child: CustomButton( child: CustomButton(
text: LocaleKeys.search.tr(), text: LocaleKeys.search.tr(context: context),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
widget.onRangeSelected(model.fromDate, model.toDate); widget.onRangeSelected(model.fromDate, model.toDate);
@ -216,7 +216,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
fromDateComponent() { fromDateComponent() {
return Consumer<DateRangeSelectorRangeViewModel>( return Consumer<DateRangeSelectorRangeViewModel>(
builder: (_, model, __) { builder: (_, model, __) {
return displayDate(LocaleKeys.startDate.tr(), return displayDate(LocaleKeys.startDate.tr(context: context),
model.getDateString(model.fromDate), model.fromDate == null); model.getDateString(model.fromDate), model.fromDate == null);
}, },
); );
@ -225,7 +225,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
toDateComponent() { toDateComponent() {
return Consumer<DateRangeSelectorRangeViewModel>( return Consumer<DateRangeSelectorRangeViewModel>(
builder: (_, model, __) { builder: (_, model, __) {
return displayDate(LocaleKeys.endDate.tr(), return displayDate(LocaleKeys.endDate.tr(context: context),
model.getDateString(model.toDate), model.toDate == null); model.getDateString(model.toDate), model.toDate == null);
}, },
); );
@ -270,7 +270,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
spacing: 8.h, spacing: 8.h,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
labelText: "This Week".needTranslation, labelText: LocaleKeys.thisWeek.tr(context: context),
backgroundColor: model.currentlySelectedRange == Range.WEEKLY backgroundColor: model.currentlySelectedRange == Range.WEEKLY
? AppColors.primaryRedColor.withOpacity(0.1) ? AppColors.primaryRedColor.withOpacity(0.1)
: AppColors.whiteColor, : AppColors.whiteColor,
@ -288,7 +288,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
model.calculateDatesFromRange(); model.calculateDatesFromRange();
}), }),
AppCustomChipWidget( AppCustomChipWidget(
labelText: "Last Month".needTranslation, labelText: LocaleKeys.lastMonth.tr(context: context),
backgroundColor: model.currentlySelectedRange == Range.LAST_MONTH backgroundColor: model.currentlySelectedRange == Range.LAST_MONTH
? AppColors.primaryRedColor.withOpacity(0.1) ? AppColors.primaryRedColor.withOpacity(0.1)
: AppColors.whiteColor, : AppColors.whiteColor,
@ -306,7 +306,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
model.calculateDatesFromRange(); model.calculateDatesFromRange();
}), }),
AppCustomChipWidget( AppCustomChipWidget(
labelText: "Last 6 Months".needTranslation, labelText: LocaleKeys.lastSixMonths.tr(context: context),
backgroundColor: model.currentlySelectedRange == Range.LAST_6MONTH backgroundColor: model.currentlySelectedRange == Range.LAST_6MONTH
? AppColors.primaryRedColor.withOpacity(0.1) ? AppColors.primaryRedColor.withOpacity(0.1)
: AppColors.whiteColor, : AppColors.whiteColor,

@ -77,7 +77,7 @@ class FamilyFileAddWidget extends StatelessWidget {
), ),
SizedBox(height: 20.h), SizedBox(height: 20.h),
CustomButton( CustomButton(
text: "Verify the member".needTranslation, text: LocaleKeys.pleaseVerify.tr(context: context),
onPressed: () { onPressed: () {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
if (ValidationUtils.isValidatedIdAndPhoneWithCountryValidation( if (ValidationUtils.isValidatedIdAndPhoneWithCountryValidation(

@ -1,9 +1,11 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_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'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
@ -154,7 +156,7 @@ class LocationMapWidget extends StatelessWidget {
child: SizedBox( child: SizedBox(
width: MediaQuery.of(context).size.width * 0.785, width: MediaQuery.of(context).size.width * 0.785,
child: CustomButton( child: CustomButton(
text: "Get Directions".needTranslation, text: LocaleKeys.getDirections.tr(context: context),
onPressed: onDirectionsTap ?? _defaultLaunchDirections, onPressed: onDirectionsTap ?? _defaultLaunchDirections,
backgroundColor: AppColors.textColor.withValues(alpha: 0.8), backgroundColor: AppColors.textColor.withValues(alpha: 0.8),
borderColor: AppColors.textColor.withValues(alpha: 0.01), borderColor: AppColors.textColor.withValues(alpha: 0.01),

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/location/location_view_model.dart'; import 'package:hmg_patient_app_new/features/location/location_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/widgets/location_input_bottom_sheet.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/widgets/location_input_bottom_sheet.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
@ -126,14 +128,14 @@ class MapUtilityScreen extends StatelessWidget {
weight: FontWeight.w600, weight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
), ),
subTitleString.needTranslation.toText12( subTitleString.toText12(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.greyTextColor, color: AppColors.greyTextColor,
) )
], ],
), ),
CustomButton( CustomButton(
text: confirmButtonString.needTranslation, text: confirmButtonString,
onPressed: () { onPressed: () {
if (onSubmitted != null) { if (onSubmitted != null) {
onSubmitted!(); onSubmitted!();
@ -172,8 +174,8 @@ class MapUtilityScreen extends StatelessWidget {
return SizedBox( return SizedBox(
width: MediaQuery.sizeOf(context).width, width: MediaQuery.sizeOf(context).width,
child: TextInputWidget( child: TextInputWidget(
labelText: "Enter Pickup Location Manually".needTranslation, labelText: LocaleKeys.enterPickupLocationManually.tr(context: context),
hintText: "Enter Pickup Location".needTranslation, hintText: LocaleKeys.enterPickupLocation.tr(context: context),
controller: TextEditingController( controller: TextEditingController(
text: vm.geocodeResponse?.results.first.formattedAddress ?? vm.selectedPrediction?.description, text: vm.geocodeResponse?.results.first.formattedAddress ?? vm.selectedPrediction?.description,
), ),
@ -203,7 +205,7 @@ class MapUtilityScreen extends StatelessWidget {
openLocationInputBottomSheet(BuildContext context) { openLocationInputBottomSheet(BuildContext context) {
context.read<LocationViewModel>().flushSearchPredictions(); context.read<LocationViewModel>().flushSearchPredictions();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: "".needTranslation, title: "",
context, context,
child: SizedBox( child: SizedBox(
height: MediaQuery.sizeOf(context).height * .8, height: MediaQuery.sizeOf(context).height * .8,

@ -1,9 +1,11 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/app_export.dart';
import 'package:hmg_patient_app_new/core/utils/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/string_extensions.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/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
@ -150,7 +152,7 @@ class _TimePickerBottomSheetState extends State<_TimePickerBottomSheet> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Select Time".needTranslation.toText18( LocaleKeys.selectTime.tr(context: context).toText18(
weight: FontWeight.w600, weight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
), ),
@ -318,7 +320,7 @@ class _TimePickerBottomSheetState extends State<_TimePickerBottomSheet> {
Expanded( Expanded(
child: CustomButton( child: CustomButton(
height: 56.h, height: 56.h,
text: "Cancel".needTranslation, text: LocaleKeys.cancel.tr(context: context),
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
textColor: AppColors.textColor, textColor: AppColors.textColor,
backgroundColor: AppColors.greyColor, backgroundColor: AppColors.greyColor,
@ -329,7 +331,7 @@ class _TimePickerBottomSheetState extends State<_TimePickerBottomSheet> {
Expanded( Expanded(
child: CustomButton( child: CustomButton(
height: 56.h, height: 56.h,
text: "Confirm".needTranslation, text: LocaleKeys.confirm.tr(context: context),
onPressed: () { onPressed: () {
Navigator.pop(context, _getCurrentTime()); Navigator.pop(context, _getCurrentTime());
}, },

Loading…
Cancel
Save