This commit is contained in:
2026-03-20 01:08:46 +03:00
commit 3dcbb6164e
142 changed files with 6599 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../shared/models/transaction.dart';
import '../dashboard/provider.dart';
final categoryExpenseProvider = Provider<Map<String, double>>((ref) {
final txs = ref.watch(transactionsProvider)
.where((t) => t.type == TransactionType.expense);
final map = <String, double>{};
for (final t in txs) {
map[t.category] = (map[t.category] ?? 0) + t.amount;
}
return map;
});