Improved layout, fixed transaction popup
This commit is contained in:
@@ -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()),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user