diff --git a/lib/presentation/tag_investment_presenter.dart b/lib/presentation/tag_investment_presenter.dart index 71035e6..dc07a92 100644 --- a/lib/presentation/tag_investment_presenter.dart +++ b/lib/presentation/tag_investment_presenter.dart @@ -25,8 +25,17 @@ class TagInvestmentPresenter extends Presenter { } void fetchInvestments() { - _investmentService.get().then((investments) => - updateViewState((viewState) => viewState.investments = investments)); + _goalInvestmentService.getBy(goalId: _goalId).then((goalInvestments) { + final List investmentIds = + goalInvestments.map((e) => e.investmentId).toList(); + _investmentService.get().then((investments) { + updateViewState((viewState) { + viewState.investments = investments + .where((element) => !investmentIds.contains(element.id)) + .toList(); + }); + }); + }); } void tagInvestment({final int? idToUpdate}) { diff --git a/lib/ui/custom/currency_text_input_formatter.dart b/lib/ui/custom/currency_text_input_formatter.dart index ff8df50..d53ffee 100644 --- a/lib/ui/custom/currency_text_input_formatter.dart +++ b/lib/ui/custom/currency_text_input_formatter.dart @@ -5,7 +5,7 @@ import 'package:intl/intl.dart'; class CurrencyTextInputFormatter extends TextInputFormatter { CurrencyTextInputFormatter() { - _format = NumberFormat.currency(symbol: '', decimalDigits: 0); + _format = NumberFormat.currency(locale: 'en_IN', symbol: '', decimalDigits: 0); } late NumberFormat _format; diff --git a/lib/utils/ui_utils.dart b/lib/utils/ui_utils.dart index 33f9ff0..c8fac1d 100644 --- a/lib/utils/ui_utils.dart +++ b/lib/utils/ui_utils.dart @@ -20,8 +20,8 @@ String formatDecimal(double value) { return value == value.round() ? '${value.round()}' : value.toStringAsFixed(2); } -String formatToCurrency(double value, { locale = 'en'}) { - return NumberFormat.currency(locale: locale, symbol: '', decimalDigits: 2).format(value); +String formatToCurrency(double value, { locale = 'en_IN'}) { + return NumberFormat.currency(locale: locale, symbol: '', decimalDigits: 0).format(value); } double? parseCurrency(String value) {