Skip to content

Commit

Permalink
Ignore the loan part
Browse files Browse the repository at this point in the history
  • Loading branch information
praslnx8 committed Nov 1, 2024
1 parent f5034fb commit c872ba3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/ui/presentation/dashboard_presenter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ class DashboardPresenter extends Presenter<DashboardViewState> {
Map<DateTime, double> dateInvestmentMap = {};

for (var investment in investments) {
investment
.getPayments(till: DateTime.now())
.map((e) => MapEntry(e.createdOn, e.amount))
.forEach((entry) {
dateInvestmentMap.update(entry.key, (value) => value + entry.value,
ifAbsent: () => entry.value);
});
if (investment.getValue() > 0) {
investment
.getPayments(till: DateTime.now())
.map((e) => MapEntry(e.createdOn, e.amount))
.forEach((entry) {
dateInvestmentMap.update(entry.key, (value) => value + entry.value,
ifAbsent: () => entry.value);
});
}
}
dateInvestmentMap.update(DateTime.now(), (value) => value,
ifAbsent: () => 0);
Expand Down

0 comments on commit c872ba3

Please sign in to comment.