UserProfileModel class

A class representing a user's profile model.

Annotations
  • @JsonSerializable(explicitToJson: true)

Constructors

UserProfileModel({String? id, String? name, int? age, GenderSelection gender = GenderSelection.male, double? weight, double? height, MeasurementSystem heightUnit = MeasurementSystem.imperial, MeasurementSystem weightUnit = MeasurementSystem.imperial, double targetWeight = 58.967, double targetWater = 591.471, ActivityLevel? activityLevel, CalorieDeficit calorieDeficit = CalorieDeficit.maintainWeight})
UserProfileModel.fromJson(Map<String, dynamic> json)
Constructs a UserProfileModel instance from a JSON map.
factory

Properties

bmi double?
Calculates Body Mass Index (BMI) based on weight and height.
no setter
bmiDescription String
Returns a description of BMI category based on calculated BMI value.
no setter
caloriesTarget int
Stores the target daily calorie intake.
getter/setter pair
carbsGram int
Calculates the total grams of carbohydrates based on the percentage and total calorie target.
no setter
carbsPercentage int
Stores the percentage of carbohydrates in the diet.
getter/setter pair
fatGram int
Calculates the total grams of fat based on the percentage and total calorie target.
no setter
fatPercentage int
Stores the percentage of fat in the diet.
getter/setter pair
gender GenderSelection
getter/setter pair
hashCode int
Overrides the hashCode method.
no setteroverride
heightDescription String
Gets the description of the user's height based on the measurement system.
no setter
heightInMeasurementSystem → ({int subunit, int unit})
Gets the height in the specified measurement system. Returns a tuple containing the unit and subunit (e.g., unit = meters, subunit = centimeters for metric).
no setter
heightUnit MeasurementSystem
getter/setter pair
id String?
Unique identifier for the user profile.
getter/setter pair
name String?
Name of the user.
getter/setter pair
proteinGram int
Calculates the total grams of protein based on the percentage and total calorie target.
no setter
proteinPercentage int
Stores the percentage of protein in the diet.
getter/setter pair
recommendedCalories int
Gets the recommended daily calorie intake based on the user's profile.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
weightUnit MeasurementSystem
getter/setter pair

Methods

balance3Values({required int first, required int second, required int third}) → (int, int, int)
Balances three values ensuring they sum up to 100.
getActivityLevel() ActivityLevel?
Gets the user's activity level.
getAge() int?
Get the age of the user.
getCalorieDeficit() CalorieDeficit
Gets the user's selected calorie deficit.
getHeight() double?
Gets the user's height.
getPassioMealPlan() PassioMealPlan?
Gets the user's meal plan.
getTargetWater() double?
Gets the target water volume based on the current measurement system.
getTargetWeight() double?
Gets the target weight based on the current measurement system.
getWeight() double?
Get the weight of the user.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setActivityLevel(ActivityLevel? activityLevel) → void
Sets the user's activity level and updates the recommended calorie target if needed.
setAge(int? age) → void
Set the age of the user.
setCalorieDeficit(CalorieDeficit calorieDeficit) → void
Sets the user's selected calorie deficit and updates the recommended calorie target if needed.
setCarbsPercentage(int carbs) → void
Sets the percentage of carbohydrates in the diet and adjusts other nutrient percentages to maintain balance.
setFatPercentage(int fat) → void
Sets the percentage of fat in the diet and adjusts other nutrient percentages to maintain balance.
setHeight(int value1, int value2) → void
setPassioMealPlan(PassioMealPlan mealPlan) → void
Sets the user's meal plan and updates the nutrient percentages accordingly.
setProteinPercentage(int protein) → void
Sets the percentage of protein in the diet and adjusts other nutrient percentages to maintain balance.
setTargetWater(double water) → void
Sets the target water volume based on the provided volume and the current measurement system.
setTargetWeight(double weight) → void
Sets the target weight based on the provided weight and the current measurement system.
setWeight(double? weight) → void
Set the weight of the user.
toJson() Map<String, dynamic>
Converts the UserProfileModel instance to a JSON map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
Overrides the equality operator.
override