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