|
|
|
|
@ -48,13 +48,14 @@ class VitalSignUiModel {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (s.contains('low')) {
|
|
|
|
|
final Color yellowBg = AppColors.warningColor.withValues(alpha: 0.12);
|
|
|
|
|
// Warning for both low and overweight/underweight BMI, since they can indicate potential health issues.
|
|
|
|
|
if (s.contains('low') || s.contains('underweight') || s.contains('overweight')) {
|
|
|
|
|
final Color yellowBg = AppColors.highAndLow.withValues(alpha: 0.12);
|
|
|
|
|
return VitalSignUiModel(
|
|
|
|
|
iconBg: yellowBg,
|
|
|
|
|
iconFg: AppColors.warningColor,
|
|
|
|
|
iconFg: AppColors.highAndLow,
|
|
|
|
|
chipBg: yellowBg,
|
|
|
|
|
chipFg: AppColors.warningColor,
|
|
|
|
|
chipFg: AppColors.highAndLow,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -91,12 +92,27 @@ class VitalSignUiModel {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static String bmiStatus(dynamic bmi) {
|
|
|
|
|
if (bmi == null) return 'N/A';
|
|
|
|
|
final double bmiValue = double.tryParse(bmi.toString()) ?? 0;
|
|
|
|
|
if (bmiValue < 18.5) return 'Underweight';
|
|
|
|
|
if (bmiValue < 25) return 'Normal';
|
|
|
|
|
if (bmiValue < 30) return 'Overweight';
|
|
|
|
|
return 'High';
|
|
|
|
|
String bmiStatus = 'Normal';
|
|
|
|
|
final double bmiResult = double.tryParse(bmi.toString()) ?? 0;
|
|
|
|
|
|
|
|
|
|
if (bmiResult >= 30) {
|
|
|
|
|
bmiStatus = "High";
|
|
|
|
|
} else if (bmiResult < 30 && bmiResult >= 25) {
|
|
|
|
|
bmiStatus = "Overweight";
|
|
|
|
|
} else if (bmiResult < 25 && bmiResult >= 18.5) {
|
|
|
|
|
bmiStatus = "Normal";
|
|
|
|
|
} else if (bmiResult < 18.5) {
|
|
|
|
|
bmiStatus = "Underweight";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (bmi == null) return 'N/A';
|
|
|
|
|
// final double bmiValue = double.tryParse(bmi.toString()) ?? 0;
|
|
|
|
|
// if (bmiValue < 18.5) return 'Underweight';
|
|
|
|
|
// if (bmiValue < 25) return 'Normal';
|
|
|
|
|
// if (bmiValue < 30) return 'Overweight';
|
|
|
|
|
// return 'High';
|
|
|
|
|
|
|
|
|
|
return bmiStatus;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|