|
|
|
@ -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<BodyFat> {
|
|
|
|
|
|
|
|
|
|
final GlobalKey clinicDropdownKey = GlobalKey();
|
|
|
|
|
bool _isHeightCM = true;
|
|
|
|
|
bool _isNeckKG = true;
|
|
|
|
@ -34,7 +32,6 @@ class _BodyFatState extends State<BodyFat> {
|
|
|
|
|
double _waistValue = 0;
|
|
|
|
|
double _hipValue = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TextEditingController _heightController = new TextEditingController();
|
|
|
|
|
TextEditingController _neckController = TextEditingController();
|
|
|
|
|
TextEditingController _waistController = TextEditingController();
|
|
|
|
@ -45,12 +42,12 @@ class _BodyFatState extends State<BodyFat> {
|
|
|
|
|
List<PopupMenuItem> _waistPopupList = List();
|
|
|
|
|
List<PopupMenuItem> _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<BodyFat> {
|
|
|
|
|
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<BodyFat> {
|
|
|
|
|
double minRange;
|
|
|
|
|
double maxRange;
|
|
|
|
|
double overWeightBy;
|
|
|
|
|
|
|
|
|
|
// int waist = 5;
|
|
|
|
|
double bodyFat = 0;
|
|
|
|
|
double fat = 0;
|
|
|
|
@ -74,8 +73,6 @@ class _BodyFatState extends State<BodyFat> {
|
|
|
|
|
double calories = 0;
|
|
|
|
|
String textResult = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_neckController.text = _neckValue.toString();
|
|
|
|
@ -105,8 +102,6 @@ class _BodyFatState extends State<BodyFat> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void updateColorWaist(int type) {
|
|
|
|
|
//MG/DLT card
|
|
|
|
|
if (type == 1) {
|
|
|
|
@ -187,29 +182,29 @@ class _BodyFatState extends State<BodyFat> {
|
|
|
|
|
} 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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -247,7 +242,7 @@ class _BodyFatState extends State<BodyFat> {
|
|
|
|
|
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,
|
|
|
|
@ -395,7 +390,6 @@ class _BodyFatState extends State<BodyFat> {
|
|
|
|
|
},
|
|
|
|
|
_neckPopupList,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12.0,
|
|
|
|
|
),
|
|
|
|
@ -446,7 +440,6 @@ class _BodyFatState extends State<BodyFat> {
|
|
|
|
|
},
|
|
|
|
|
_hipPopupList,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
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}) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
|
|
|
|
@ -691,5 +685,3 @@ class CommonDropDownView extends StatelessWidget {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|