Refactored json storage

This commit is contained in:
2024-02-17 14:16:07 +01:00
parent 1a7f28703a
commit b2da8436e4
29 changed files with 389 additions and 235 deletions

View File

@@ -0,0 +1,21 @@
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(),
};
}