setAge method
Set the age of the user.
Implementation
void setAge(int? age) {
if (_age == age) return;
_age = age;
int calories = _calculateRecommendedCalorie();
if (calories > 0) {
caloriesTarget = calories;
}
}
Set the age of the user.
void setAge(int? age) {
if (_age == age) return;
_age = age;
int calories = _calculateRecommendedCalorie();
if (calories > 0) {
caloriesTarget = calories;
}
}