diff --git a/lib/ui/presentation/dashboard_presenter.dart b/lib/ui/presentation/dashboard_presenter.dart index 4c8d408..be14dcc 100644 --- a/lib/ui/presentation/dashboard_presenter.dart +++ b/lib/ui/presentation/dashboard_presenter.dart @@ -74,13 +74,15 @@ class DashboardPresenter extends Presenter { Map 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);