25 lines
564 B
Dart
25 lines
564 B
Dart
|
class AlertConfiguration {
|
||
|
int nutrientId;
|
||
|
double maxValue;
|
||
|
double minValue;
|
||
|
|
||
|
AlertConfiguration({
|
||
|
required this.nutrientId,
|
||
|
required this.maxValue,
|
||
|
required this.minValue,
|
||
|
});
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
'nutrient_id': nutrientId,
|
||
|
'min_value': minValue,
|
||
|
'max_value': maxValue,
|
||
|
};
|
||
|
|
||
|
factory AlertConfiguration.fromJson(Map<String, dynamic> json) =>
|
||
|
AlertConfiguration(
|
||
|
nutrientId: json['nutrient_id'],
|
||
|
minValue: json['min_value'],
|
||
|
maxValue: json['max_value'],
|
||
|
);
|
||
|
}
|