Basic budget sliders

This commit is contained in:
2024-02-25 19:20:18 +01:00
parent 2b53d1ab74
commit 979fecb60a
10 changed files with 219 additions and 71 deletions

View File

@@ -1,20 +1,24 @@
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(
monthly: json['monthly'],
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(),
};