2023-10-27 17:10:09 +02:00
|
|
|
class Preset {
|
|
|
|
final int id;
|
|
|
|
final String name;
|
|
|
|
final double calories;
|
|
|
|
final double protein;
|
|
|
|
final double carb;
|
|
|
|
final double fat;
|
|
|
|
final double fiber;
|
|
|
|
|
|
|
|
Preset({
|
|
|
|
required this.id,
|
|
|
|
required this.name,
|
|
|
|
required this.calories,
|
|
|
|
required this.protein,
|
|
|
|
required this.carb,
|
|
|
|
required this.fat,
|
|
|
|
required this.fiber,
|
|
|
|
});
|
|
|
|
|
|
|
|
Preset.fromJson(Map<String, dynamic> map)
|
|
|
|
: id = map['id'] as int,
|
|
|
|
name = map['name'] as String,
|
|
|
|
calories = map['calories'] as double,
|
|
|
|
protein = map['protein'] as double,
|
|
|
|
carb = map['carb'] as double,
|
|
|
|
fat = map['fat'] as double,
|
|
|
|
fiber = map['fiber'] as double;
|
2024-08-09 14:48:27 +02:00
|
|
|
|
|
|
|
Map<String, Object?> toMap() {
|
|
|
|
return {
|
|
|
|
'id': id,
|
|
|
|
'name': name,
|
|
|
|
'calories': calories,
|
|
|
|
'protein': protein,
|
|
|
|
'fat': fat,
|
|
|
|
'fiber': fiber,
|
|
|
|
'carb': carb,
|
|
|
|
};
|
|
|
|
}
|
2023-10-27 17:10:09 +02:00
|
|
|
}
|