This commit is contained in:
2026-03-22 01:35:21 +03:00
parent 606caab8d8
commit ca5bfa7258
3 changed files with 100 additions and 6 deletions
+11
View File
@@ -13,6 +13,17 @@ final categoryExpenseProvider = Provider<Map<String, double>>((ref) {
return map;
});
final categoryIncomeProvider = Provider<Map<String, double>>((ref) {
final txs = ref.watch(transactionsProvider)
.where((t) => t.type == TransactionType.income);
final map = <String, double>{};
for (final t in txs) {
map[t.category] = (map[t.category] ?? 0) + t.amount;
}
return map;
});
final monthlyBreakdownProvider = Provider<List<MonthlyData>>((ref) {
final txs = ref.watch(transactionsProvider)
.where((t) => t.type == TransactionType.expense);