setAge method

void setAge(
  1. int? age
)

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;
  }
}