@ -1,4 +1,6 @@
import ' package:easy_localization/easy_localization.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:hmg_patient_app_new/generated/locale_keys.g.dart ' ;
import ' package:hmg_patient_app_new/theme/colors.dart ' ;
import ' package:hmg_patient_app_new/theme/colors.dart ' ;
/ / / UI - only helper model for Vital Sign cards .
/ / / UI - only helper model for Vital Sign cards .
@ -49,7 +51,7 @@ class VitalSignUiModel {
}
}
/ / Warning for both low and overweight / underweight BMI , since they can indicate potential health issues .
/ / 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 ' ) ) {
if ( s . contains ( ' low ' ) | | s . contains ( LocaleKeys . underWeight . tr ( ) ) | | s . contains ( LocaleKeys . overWeight . tr ( ) ) ) {
final Color yellowBg = AppColors . highAndLow . withValues ( alpha: 0.12 ) ;
final Color yellowBg = AppColors . highAndLow . withValues ( alpha: 0.12 ) ;
return VitalSignUiModel (
return VitalSignUiModel (
iconBg: yellowBg ,
iconBg: yellowBg ,
@ -96,13 +98,13 @@ class VitalSignUiModel {
final double bmiResult = double . tryParse ( bmi . toString ( ) ) ? ? 0 ;
final double bmiResult = double . tryParse ( bmi . toString ( ) ) ? ? 0 ;
if ( bmiResult > = 30 ) {
if ( bmiResult > = 30 ) {
bmiStatus = " High " ;
bmiStatus = LocaleKeys . obese . tr ( ) ;
} else if ( bmiResult < 30 & & bmiResult > = 25 ) {
} else if ( bmiResult < 30 & & bmiResult > = 25 ) {
bmiStatus = " Overweight " ;
bmiStatus = LocaleKeys . overWeight . tr ( ) ;
} else if ( bmiResult < 25 & & bmiResult > = 18.5 ) {
} else if ( bmiResult < 25 & & bmiResult > = 18.5 ) {
bmiStatus = " Normal " ;
bmiStatus = LocaleKeys . normal . tr ( ) ;
} else if ( bmiResult < 18.5 ) {
} else if ( bmiResult < 18.5 ) {
bmiStatus = " Underweight " ;
bmiStatus = LocaleKeys . underWeight . tr ( ) ;
}
}
/ / if ( bmi = = null ) return ' N/A ' ;
/ / if ( bmi = = null ) return ' N/A ' ;