Improved layout, fixed transaction popup

This commit is contained in:
2024-02-11 17:28:21 +01:00
parent 44f6d433d1
commit cbaf94d866
21 changed files with 378 additions and 204 deletions

View File

@@ -9,11 +9,13 @@ class Account {
List<Transaction> transactions;
List<Budget> budgets;
List<Category> categories;
Set<String> subAccounts;
Account({
this.transactions = const [],
this.budgets = const [],
this.categories = const [],
this.subAccounts = const {},
});
factory Account.fromJson(Map<String, dynamic> json) {
@@ -21,6 +23,7 @@ class Account {
transactions: (jsonDecode(json['transactions']) as List<dynamic>).map((transaction) => Transaction.fromJson(transaction)).toList(),
budgets: (jsonDecode(json['budgets']) as List<dynamic>).map((budget) => Budget.fromJson(budget)).toList(),
categories: (jsonDecode(json['categories']) as List<dynamic>).map((category) => Category.fromJson(category)).toList(),
subAccounts: Set.from(jsonDecode(json['subAccounts'])),
);
}
@@ -28,5 +31,6 @@ class Account {
'transactions': jsonEncode(transactions.map((transaction) => transaction.toJson()).toList()),
'budgets': jsonEncode(budgets.map((budget) => budget.toJson()).toList()),
'categories': jsonEncode(categories.map((category) => category.toJson()).toList()),
'subAccounts': jsonEncode(subAccounts.toList()),
};
}