From dc3d3bc7726cdfe5a0a4ea37ec6e174e12b4dfd7 Mon Sep 17 00:00:00 2001 From: devmirza121 Date: Wed, 10 Nov 2021 10:16:04 +0300 Subject: [PATCH] Health Calculator 5.0 --- lib/config/localized_values.dart | 7 +++- .../bmr_calculator/bmr_calculator.dart | 2 +- .../calorie_calculator.dart | 1 + .../health_calculator/carbs/carbs.dart | 2 +- .../carbs/carbs_result_page.dart | 32 +++++++++---------- .../ideal_body/ideal_body.dart | 2 +- lib/uitl/translations_delegate_base.dart | 5 +++ 7 files changed, 31 insertions(+), 20 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4a8ee340..46f60222 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1636,7 +1636,7 @@ const Map localizedValues = { "waist": {"en": "Waist", "ar": "وسط"}, "hip": {"en": "Hip", "ar": "ورك او نتوء"}, "carbsProtin": {"en": "Carbs, Protein and Fat", "ar": "الكربوهيدرات والبروتينات والدهون"}, - "usefulInfo": {"en": "Useful Information", "ar": "Useful Information"}, + "usefulInfo": {"en": "Useful Information", "ar": "معلومات مفيدة"}, "babyAge": {"en": "Baby Age", "ar": "عمر الطفل الآن:"}, "babyAgeAvail": {"en": "baby age is not available", "ar": "عمر الطفل غير متوفر"}, "deliveryDue": {"en": "The delivery due date is estimated to be on the", "ar": "من المقدر أن يكون تاريخ استحقاق التسليم في"}, @@ -1705,4 +1705,9 @@ const Map localizedValues = { "dietUSDA":{"en":"USDA Guidelines","ar":"ارشادات وزارة الزراعة الأمريكية"}, "dietZone":{"en":"Zone Diet","ar":"حمية زون"}, + "Protein": {"en": "Protein", "ar": "بروتين"}, + "Cals": {"en": "Cals", "ar": "كالس"}, + "gramsPerDay": {"en": "Grams Per Day", "ar": "غرام في اليوم"}, + "gr": {"en": "gr", "ar": "غرام"}, + "gramsPerMeal": {"en": "Grams Per Meal", "ar": "عدد الجرامات لكل وجبة"}, }; diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart index e2010445..62020a62 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -357,7 +357,7 @@ class _BmrCalculatorState extends State { height: 18, child: DropdownButtonHideUnderline( child: DropdownButton( - value: dropdownValue, + value: dropdownValue, key: clinicDropdownKey, icon: Icon(Icons.arrow_downward), iconSize: 0, elevation: 16, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart index f1db7e82..b7e00652 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -290,6 +290,7 @@ class _CalorieCalculatorState extends State { child: DropdownButtonHideUnderline( child: DropdownButton( value: dropdownValue, + key: clinicDropdownKey, icon: Icon(Icons.arrow_downward), iconSize: 0, elevation: 16, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart index 31990a6b..9f2c6842 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -171,7 +171,7 @@ class _CarbsState extends State { height: 18, child: DropdownButtonHideUnderline( child: DropdownButton( - value: dropdownValue, + value: dropdownValue, key: clinicDropdownKey, icon: Icon(Icons.arrow_downward), iconSize: 0, elevation: 16, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart index 43019deb..44363734 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart @@ -91,10 +91,10 @@ class CarbsResult extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnTitle("Description"), - Utils.tableColumnTitle("Protein"), - Utils.tableColumnTitle("Carbohydrate"), - Utils.tableColumnTitle("Fat"), + Utils.tableColumnTitle(TranslationBase.of(context).description), + Utils.tableColumnTitle(TranslationBase.of(context).Protein), + Utils.tableColumnTitle(TranslationBase.of(context).carbohydrate), + Utils.tableColumnTitle(TranslationBase.of(context).fat), ], ), ); @@ -102,10 +102,10 @@ class CarbsResult extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue("Calories Per Day", isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(pCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(cCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(cCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(TranslationBase.of(context).calDay, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(pCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(cCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(cCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel), ], ), ); @@ -113,20 +113,20 @@ class CarbsResult extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue("Grams Per Day", isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(pCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(cCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(fCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(TranslationBase.of(context).gramsPerDay, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(pCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(cCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(fCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel), ], ), ); tableRow.add( TableRow( children: [ - Utils.tableColumnValue('Grams Per Meal', isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(pCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(cCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(fCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(TranslationBase.of(context).gramsPerMeal, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(pCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(cCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(fCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel), ], ), ); diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart index 265bb412..a594846e 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -200,7 +200,7 @@ class _IdealBodyState extends State { child: DropdownButtonHideUnderline( child: DropdownButton( value: dropdownValue, - icon: Icon(Icons.arrow_downward), + icon: Icon(Icons.arrow_downward), key: clinicDropdownKey, iconSize: 0, elevation: 16, isExpanded: true, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 80425967..3c878c19 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2727,6 +2727,11 @@ class TranslationBase { String get estimates => localizedValues["estimates"][locale.languageCode]; String get submitReview => localizedValues["submitReview"][locale.languageCode]; + String get Protein => localizedValues["Protein"][locale.languageCode]; + String get Cals => localizedValues["Cals"][locale.languageCode]; + String get gramsPerDay => localizedValues["gramsPerDay"][locale.languageCode]; + String get gr => localizedValues["gr"][locale.languageCode]; + String get gramsPerMeal => localizedValues["gramsPerMeal"][locale.languageCode];