From 7b74c415ac4bedf617ea3aeff4f18b7a50d1df03 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 30 Aug 2022 08:15:17 -0600 Subject: [PATCH] searched single base currency selection bugfix --- .../global_settings_view/currency_view.dart | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/pages/settings_views/global_settings_view/currency_view.dart b/lib/pages/settings_views/global_settings_view/currency_view.dart index 31bbe0fec..7cb3c51e2 100644 --- a/lib/pages/settings_views/global_settings_view/currency_view.dart +++ b/lib/pages/settings_views/global_settings_view/currency_view.dart @@ -31,7 +31,7 @@ class _CurrencyViewState extends ConsumerState { final _searchFocusNode = FocusNode(); void onTap(int index) { - if (index == 0 || current.isEmpty) { + if (currenciesWithoutSelected[index] == current || current.isEmpty) { // ignore if already selected currency return; } @@ -212,7 +212,7 @@ class _CurrencyViewState extends ConsumerState { "currencySelect_${currenciesWithoutSelected[index]}"), child: RoundedContainer( padding: const EdgeInsets.all(0), - color: index == 0 + color: currenciesWithoutSelected[index] == current ? CFColors.selected : CFColors.white, child: RawMaterialButton( @@ -238,7 +238,9 @@ class _CurrencyViewState extends ConsumerState { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, value: true, - groupValue: index == 0, + groupValue: currenciesWithoutSelected[ + index] == + current, onChanged: (_) { onTap(index); }, @@ -253,7 +255,9 @@ class _CurrencyViewState extends ConsumerState { children: [ Text( currenciesWithoutSelected[index], - key: (index == 0) + key: (currenciesWithoutSelected[ + index] == + current) ? const Key( "selectedCurrencySettingsCurrencyText") : null, @@ -269,7 +273,9 @@ class _CurrencyViewState extends ConsumerState { currenciesWithoutSelected[ index]] ?? "", - key: (index == 0) + key: (currenciesWithoutSelected[ + index] == + current) ? const Key( "selectedCurrencySettingsCurrencyTextDescription") : null,