Files
Krezus/lib/repositories/metadata/models/budget.dart
2024-02-25 19:20:18 +01:00

26 lines
480 B
Dart

class Budget {
String label;
bool monthly;
double value;
Budget({
this.label = '',
this.monthly = false,
this.value = 0.0,
});
factory Budget.fromJson(Map<String, dynamic> json) {
return Budget(
label: json['label'],
monthly: bool.parse(json['monthly']),
value: double.parse(json['value']),
);
}
Map<String, String> toJson() => {
'label': label,
'monthly': monthly.toString(),
'value': value.toString(),
};
}