diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index 5cdd8e3b..6aab447a 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -23,7 +22,6 @@ class BodyFat extends StatefulWidget { } class _BodyFatState extends State { - final GlobalKey clinicDropdownKey = GlobalKey(); bool _isHeightCM = true; bool _isNeckKG = true; @@ -34,7 +32,6 @@ class _BodyFatState extends State { double _waistValue = 0; double _hipValue = 0; - TextEditingController _heightController = new TextEditingController(); TextEditingController _neckController = TextEditingController(); TextEditingController _waistController = TextEditingController(); @@ -45,12 +42,12 @@ class _BodyFatState extends State { List _waistPopupList = List(); List _hipPopupList = List(); - - bool isMale = false; + // bool isHeightCm = true; Color maleCard = activeCardColorGender; Color femaleCard = inactiveCardColorGender; + // Color neckCmCard = activeCardColor; // Color neckFtCard = inactiveCardColor; Color waistCmCard = activeCardColor; @@ -59,6 +56,7 @@ class _BodyFatState extends State { Color hipFtCard = inactiveCardColor; Color cmCard = activeCardColor; Color ftCard = inactiveCardColor; + // int neck = 10; // int heightCm = 0; // int heightFt = 0; @@ -67,6 +65,7 @@ class _BodyFatState extends State { double minRange; double maxRange; double overWeightBy; + // int waist = 5; double bodyFat = 0; double fat = 0; @@ -74,8 +73,6 @@ class _BodyFatState extends State { double calories = 0; String textResult = ''; - - @override void initState() { _neckController.text = _neckValue.toString(); @@ -105,8 +102,6 @@ class _BodyFatState extends State { } } - - void updateColorWaist(int type) { //MG/DLT card if (type == 1) { @@ -187,29 +182,29 @@ class _BodyFatState extends State { } else if (bodyFat > 13 && bodyFat <= 20) { textResult = TranslationBase.of(context).athlete; } else if (bodyFat > 20 && bodyFat <= 24) { - textResult =TranslationBase.of(context).fitness; + textResult = TranslationBase.of(context).fitness; } else if (bodyFat > 24 && bodyFat <= 31) { - textResult =TranslationBase.of(context).acceptable; + textResult = TranslationBase.of(context).acceptable; } else if (bodyFat > 31 && bodyFat <= 60) { - textResult =TranslationBase.of(context).underObese; + textResult = TranslationBase.of(context).underObese; } else if (bodyFat > 60) { - textResult =TranslationBase.of(context).crossedLimits; + textResult = TranslationBase.of(context).crossedLimits; } else if (bodyFat <= 9) { - textResult =TranslationBase.of(context).lowLimits; + textResult = TranslationBase.of(context).lowLimits; } } else { if (bodyFat > 5 && fat <= 13) { - textResult = 'The category falls under essential'; + textResult = TranslationBase.of(context).essential; } else if (bodyFat > 13 && bodyFat <= 17) { - textResult = 'The category falls under athlete'; + textResult = TranslationBase.of(context).athlete; } else if (bodyFat > 17 && bodyFat <= 24) { - textResult = 'The category falls under fitness'; + textResult = TranslationBase.of(context).fitness; } else if (bodyFat > 24 && bodyFat <= 45) { - textResult = 'The category falls under obese'; + textResult = TranslationBase.of(context).underObese; } else if (bodyFat > 45) { - textResult = 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + textResult = TranslationBase.of(context).crossedLimits; } else if (bodyFat <= 5) { - textResult = 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + textResult = TranslationBase.of(context).lowLimits; } } } @@ -242,12 +237,12 @@ class _BodyFatState extends State { Expanded( child: SingleChildScrollView( child: Container( - padding: EdgeInsets.all(20), + padding: EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - 'Estimates the total body fat based on\nthe size', + TranslationBase.of(context).bodyFatDesc, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -354,14 +349,14 @@ class _BodyFatState extends State { 1, 270, _heightValue, - (text) { + (text) { _heightController.text = text; }, - (value) { + (value) { _heightValue = value; }, _isHeightCM ? TranslationBase.of(context).cm : TranslationBase.of(context).ft, - (value) { + (value) { if (_isHeightCM != value) { setState(() { _isHeightCM = value; @@ -379,14 +374,14 @@ class _BodyFatState extends State { 1, 270, _neckValue, - (text) { - _neckController.text = text; + (text) { + _neckController.text = text; }, - (value) { - _neckValue = value; + (value) { + _neckValue = value; }, _isNeckKG ? TranslationBase.of(context).cm : TranslationBase.of(context).ft, - (value) { + (value) { if (_isNeckKG != value) { setState(() { _isNeckKG = value; @@ -395,7 +390,6 @@ class _BodyFatState extends State { }, _neckPopupList, ), - SizedBox( height: 12.0, ), @@ -405,14 +399,14 @@ class _BodyFatState extends State { 1, 270, _waistValue, - (text) { - _waistController.text = text; + (text) { + _waistController.text = text; }, - (value) { + (value) { _waistValue = value; }, _isWaistKG ? TranslationBase.of(context).cm : TranslationBase.of(context).ft, - (value) { + (value) { if (_isWaistKG != value) { setState(() { _isWaistKG = value; @@ -430,14 +424,14 @@ class _BodyFatState extends State { 1, 270, _hipValue, - (text) { + (text) { _hipController.text = text; }, - (value) { + (value) { _hipValue = value; }, _isHipKG ? TranslationBase.of(context).cm : TranslationBase.of(context).ft, - (value) { + (value) { if (_isHipKG != value) { setState(() { _isHipKG = value; @@ -446,7 +440,6 @@ class _BodyFatState extends State { }, _hipPopupList, ), - SizedBox( height: 12.0, ), @@ -471,10 +464,10 @@ class _BodyFatState extends State { context, FadePage( page: FatResult( - bodyFat: bodyFat, - fat: fat, - textResult: textResult, - )), + bodyFat: bodyFat, + fat: fat, + textResult: textResult, + )), ); } }); @@ -485,6 +478,7 @@ class _BodyFatState extends State { ), ); } + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), @@ -542,15 +536,15 @@ class _BodyFatState extends State { prefixIcon: prefix == null ? null : Text( - "+" + prefix, - style: TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w500, - color: Color(0xff2E303A), - letterSpacing: -0.56, - ), - ), + "+" + prefix, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w500, + color: Color(0xff2E303A), + letterSpacing: -0.56, + ), + ), contentPadding: EdgeInsets.zero, border: InputBorder.none, focusedBorder: InputBorder.none, @@ -691,5 +685,3 @@ class CommonDropDownView extends StatelessWidget { ); } } - - diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 80425967..d1bc500d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2692,44 +2692,62 @@ class TranslationBase { String get dietZone => localizedValues["dietZone"][locale.languageCode]; String get useFullInfo => localizedValues["usefulInfo"][locale.languageCode]; + String get babyAge => localizedValues["babyAge"][locale.languageCode]; + String get babyAgeAvail => localizedValues["babyAgeAvail"][locale.languageCode]; + String get deliveryDue => localizedValues["deliveryDue"][locale.languageCode]; String get almostInactive => localizedValues["almostInactive"][locale.languageCode]; + String get lightActive1 => localizedValues["lightActive1"][locale.languageCode]; + String get veryActive => localizedValues["veryActive"][locale.languageCode]; - String get superActive => localizedValues["superActive"][locale.languageCode]; + String get superActive => localizedValues["superActive"][locale.languageCode]; String get dailyIntake => localizedValues["dailyIntake"][locale.languageCode]; + String get calculateAmount => localizedValues["calculateAmount"][locale.languageCode]; + String get bodyWillBurn => localizedValues["bodyWillBurn"][locale.languageCode]; + String get caloriesEachDay => localizedValues["caloriesEachDay"][locale.languageCode]; + String get maintainWeight => localizedValues["maintainWeight"][locale.languageCode]; String get mediumFinger => localizedValues["mediumFinger"][locale.languageCode]; + String get smallFinger => localizedValues["smallFinger"][locale.languageCode]; + String get largeFinger => localizedValues["largeFinger"][locale.languageCode]; + String get idealBodyWeight => localizedValues["idealBodyWeight"][locale.languageCode]; + String get bodyFrameSize => localizedValues["bodyFrameSize"][locale.languageCode]; String get idealWeightRange => localizedValues["idealWeightRange"][locale.languageCode]; + String get currentWeightPerfect => localizedValues["currentWeightPerfect"][locale.languageCode]; + String get littleBitWeightMore => localizedValues["littleBitWeightMore"][locale.languageCode]; + String get consultWithDoctor => localizedValues["consultWithDoctor"][locale.languageCode]; + String get excessiveObesity => localizedValues["excessiveObesity"][locale.languageCode]; + String get mayWish => localizedValues["mayWish"][locale.languageCode]; String get underObese => localizedValues["underObese"][locale.languageCode]; - String get crossedLimits => localizedValues["crossedLimits"][locale.languageCode]; - String get lowLimits => localizedValues["lowLimits"][locale.languageCode]; - String get estimates => localizedValues["estimates"][locale.languageCode]; - String get submitReview => localizedValues["submitReview"][locale.languageCode]; + String get crossedLimits => localizedValues["crossedLimits"][locale.languageCode]; + String get lowLimits => localizedValues["lowLimits"][locale.languageCode]; + String get estimates => localizedValues["estimates"][locale.languageCode]; + String get submitReview => localizedValues["submitReview"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {