merge-requests/497/head
haroon amjad 3 years ago
parent 534b82461a
commit 338c646a43

@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -23,7 +22,6 @@ class BodyFat extends StatefulWidget {
} }
class _BodyFatState extends State<BodyFat> { class _BodyFatState extends State<BodyFat> {
final GlobalKey clinicDropdownKey = GlobalKey(); final GlobalKey clinicDropdownKey = GlobalKey();
bool _isHeightCM = true; bool _isHeightCM = true;
bool _isNeckKG = true; bool _isNeckKG = true;
@ -34,7 +32,6 @@ class _BodyFatState extends State<BodyFat> {
double _waistValue = 0; double _waistValue = 0;
double _hipValue = 0; double _hipValue = 0;
TextEditingController _heightController = new TextEditingController(); TextEditingController _heightController = new TextEditingController();
TextEditingController _neckController = TextEditingController(); TextEditingController _neckController = TextEditingController();
TextEditingController _waistController = TextEditingController(); TextEditingController _waistController = TextEditingController();
@ -45,12 +42,12 @@ class _BodyFatState extends State<BodyFat> {
List<PopupMenuItem> _waistPopupList = List(); List<PopupMenuItem> _waistPopupList = List();
List<PopupMenuItem> _hipPopupList = List(); List<PopupMenuItem> _hipPopupList = List();
bool isMale = false; bool isMale = false;
// bool isHeightCm = true; // bool isHeightCm = true;
Color maleCard = activeCardColorGender; Color maleCard = activeCardColorGender;
Color femaleCard = inactiveCardColorGender; Color femaleCard = inactiveCardColorGender;
// Color neckCmCard = activeCardColor; // Color neckCmCard = activeCardColor;
// Color neckFtCard = inactiveCardColor; // Color neckFtCard = inactiveCardColor;
Color waistCmCard = activeCardColor; Color waistCmCard = activeCardColor;
@ -59,6 +56,7 @@ class _BodyFatState extends State<BodyFat> {
Color hipFtCard = inactiveCardColor; Color hipFtCard = inactiveCardColor;
Color cmCard = activeCardColor; Color cmCard = activeCardColor;
Color ftCard = inactiveCardColor; Color ftCard = inactiveCardColor;
// int neck = 10; // int neck = 10;
// int heightCm = 0; // int heightCm = 0;
// int heightFt = 0; // int heightFt = 0;
@ -67,6 +65,7 @@ class _BodyFatState extends State<BodyFat> {
double minRange; double minRange;
double maxRange; double maxRange;
double overWeightBy; double overWeightBy;
// int waist = 5; // int waist = 5;
double bodyFat = 0; double bodyFat = 0;
double fat = 0; double fat = 0;
@ -74,8 +73,6 @@ class _BodyFatState extends State<BodyFat> {
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
@override @override
void initState() { void initState() {
_neckController.text = _neckValue.toString(); _neckController.text = _neckValue.toString();
@ -105,8 +102,6 @@ class _BodyFatState extends State<BodyFat> {
} }
} }
void updateColorWaist(int type) { void updateColorWaist(int type) {
//MG/DLT card //MG/DLT card
if (type == 1) { if (type == 1) {
@ -187,29 +182,29 @@ class _BodyFatState extends State<BodyFat> {
} else if (bodyFat > 13 && bodyFat <= 20) { } else if (bodyFat > 13 && bodyFat <= 20) {
textResult = TranslationBase.of(context).athlete; textResult = TranslationBase.of(context).athlete;
} else if (bodyFat > 20 && bodyFat <= 24) { } else if (bodyFat > 20 && bodyFat <= 24) {
textResult =TranslationBase.of(context).fitness; textResult = TranslationBase.of(context).fitness;
} else if (bodyFat > 24 && bodyFat <= 31) { } else if (bodyFat > 24 && bodyFat <= 31) {
textResult =TranslationBase.of(context).acceptable; textResult = TranslationBase.of(context).acceptable;
} else if (bodyFat > 31 && bodyFat <= 60) { } else if (bodyFat > 31 && bodyFat <= 60) {
textResult =TranslationBase.of(context).underObese; textResult = TranslationBase.of(context).underObese;
} else if (bodyFat > 60) { } else if (bodyFat > 60) {
textResult =TranslationBase.of(context).crossedLimits; textResult = TranslationBase.of(context).crossedLimits;
} else if (bodyFat <= 9) { } else if (bodyFat <= 9) {
textResult =TranslationBase.of(context).lowLimits; textResult = TranslationBase.of(context).lowLimits;
} }
} else { } else {
if (bodyFat > 5 && fat <= 13) { if (bodyFat > 5 && fat <= 13) {
textResult = 'The category falls under essential'; textResult = TranslationBase.of(context).essential;
} else if (bodyFat > 13 && bodyFat <= 17) { } else if (bodyFat > 13 && bodyFat <= 17) {
textResult = 'The category falls under athlete'; textResult = TranslationBase.of(context).athlete;
} else if (bodyFat > 17 && bodyFat <= 24) { } else if (bodyFat > 17 && bodyFat <= 24) {
textResult = 'The category falls under fitness'; textResult = TranslationBase.of(context).fitness;
} else if (bodyFat > 24 && bodyFat <= 45) { } else if (bodyFat > 24 && bodyFat <= 45) {
textResult = 'The category falls under obese'; textResult = TranslationBase.of(context).underObese;
} else if (bodyFat > 45) { } 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) { } 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;
} }
} }
} }
@ -247,7 +242,7 @@ class _BodyFatState extends State<BodyFat> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Estimates the total body fat based on\nthe size', TranslationBase.of(context).bodyFatDesc,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -395,7 +390,6 @@ class _BodyFatState extends State<BodyFat> {
}, },
_neckPopupList, _neckPopupList,
), ),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
@ -446,7 +440,6 @@ class _BodyFatState extends State<BodyFat> {
}, },
_hipPopupList, _hipPopupList,
), ),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
@ -485,6 +478,7 @@ class _BodyFatState extends State<BodyFat> {
), ),
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
@ -691,5 +685,3 @@ class CommonDropDownView extends StatelessWidget {
); );
} }
} }

@ -2692,44 +2692,62 @@ class TranslationBase {
String get dietZone => localizedValues["dietZone"][locale.languageCode]; String get dietZone => localizedValues["dietZone"][locale.languageCode];
String get useFullInfo => localizedValues["usefulInfo"][locale.languageCode]; String get useFullInfo => localizedValues["usefulInfo"][locale.languageCode];
String get babyAge => localizedValues["babyAge"][locale.languageCode]; String get babyAge => localizedValues["babyAge"][locale.languageCode];
String get babyAgeAvail => localizedValues["babyAgeAvail"][locale.languageCode]; String get babyAgeAvail => localizedValues["babyAgeAvail"][locale.languageCode];
String get deliveryDue => localizedValues["deliveryDue"][locale.languageCode]; String get deliveryDue => localizedValues["deliveryDue"][locale.languageCode];
String get almostInactive => localizedValues["almostInactive"][locale.languageCode]; String get almostInactive => localizedValues["almostInactive"][locale.languageCode];
String get lightActive1 => localizedValues["lightActive1"][locale.languageCode]; String get lightActive1 => localizedValues["lightActive1"][locale.languageCode];
String get veryActive => localizedValues["veryActive"][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 dailyIntake => localizedValues["dailyIntake"][locale.languageCode];
String get calculateAmount => localizedValues["calculateAmount"][locale.languageCode]; String get calculateAmount => localizedValues["calculateAmount"][locale.languageCode];
String get bodyWillBurn => localizedValues["bodyWillBurn"][locale.languageCode]; String get bodyWillBurn => localizedValues["bodyWillBurn"][locale.languageCode];
String get caloriesEachDay => localizedValues["caloriesEachDay"][locale.languageCode]; String get caloriesEachDay => localizedValues["caloriesEachDay"][locale.languageCode];
String get maintainWeight => localizedValues["maintainWeight"][locale.languageCode]; String get maintainWeight => localizedValues["maintainWeight"][locale.languageCode];
String get mediumFinger => localizedValues["mediumFinger"][locale.languageCode]; String get mediumFinger => localizedValues["mediumFinger"][locale.languageCode];
String get smallFinger => localizedValues["smallFinger"][locale.languageCode]; String get smallFinger => localizedValues["smallFinger"][locale.languageCode];
String get largeFinger => localizedValues["largeFinger"][locale.languageCode]; String get largeFinger => localizedValues["largeFinger"][locale.languageCode];
String get idealBodyWeight => localizedValues["idealBodyWeight"][locale.languageCode]; String get idealBodyWeight => localizedValues["idealBodyWeight"][locale.languageCode];
String get bodyFrameSize => localizedValues["bodyFrameSize"][locale.languageCode]; String get bodyFrameSize => localizedValues["bodyFrameSize"][locale.languageCode];
String get idealWeightRange => localizedValues["idealWeightRange"][locale.languageCode]; String get idealWeightRange => localizedValues["idealWeightRange"][locale.languageCode];
String get currentWeightPerfect => localizedValues["currentWeightPerfect"][locale.languageCode]; String get currentWeightPerfect => localizedValues["currentWeightPerfect"][locale.languageCode];
String get littleBitWeightMore => localizedValues["littleBitWeightMore"][locale.languageCode]; String get littleBitWeightMore => localizedValues["littleBitWeightMore"][locale.languageCode];
String get consultWithDoctor => localizedValues["consultWithDoctor"][locale.languageCode]; String get consultWithDoctor => localizedValues["consultWithDoctor"][locale.languageCode];
String get excessiveObesity => localizedValues["excessiveObesity"][locale.languageCode]; String get excessiveObesity => localizedValues["excessiveObesity"][locale.languageCode];
String get mayWish => localizedValues["mayWish"][locale.languageCode]; String get mayWish => localizedValues["mayWish"][locale.languageCode];
String get underObese => localizedValues["underObese"][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<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save