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