Budget.fromMap constructor
Creates an Budget
instance starting from a Map<String, dynamic> map
.
This can be useful for retrieving the instance in a database.
Implementation
Budget.fromMap(Map<String, dynamic> map)
: name = '${map[_nameKey]}',
renewal = '${map[_renewalKey]}'.toRenewal(),
size = '${map[_sizeKey]}'.toMoney(),
start = DateTime.parse('${map[_startKey]}'),
transactions = <MoneyTransaction>[]
.fromList(map[_transactionsKey] as List<dynamic>);