searched single base currency selection bugfix

This commit is contained in:
julian 2022-08-30 08:15:17 -06:00
parent 84d75f6e8f
commit 7b74c415ac

View file

@ -31,7 +31,7 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
final _searchFocusNode = FocusNode(); final _searchFocusNode = FocusNode();
void onTap(int index) { void onTap(int index) {
if (index == 0 || current.isEmpty) { if (currenciesWithoutSelected[index] == current || current.isEmpty) {
// ignore if already selected currency // ignore if already selected currency
return; return;
} }
@ -212,7 +212,7 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
"currencySelect_${currenciesWithoutSelected[index]}"), "currencySelect_${currenciesWithoutSelected[index]}"),
child: RoundedContainer( child: RoundedContainer(
padding: const EdgeInsets.all(0), padding: const EdgeInsets.all(0),
color: index == 0 color: currenciesWithoutSelected[index] == current
? CFColors.selected ? CFColors.selected
: CFColors.white, : CFColors.white,
child: RawMaterialButton( child: RawMaterialButton(
@ -238,7 +238,9 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
materialTapTargetSize: materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap, MaterialTapTargetSize.shrinkWrap,
value: true, value: true,
groupValue: index == 0, groupValue: currenciesWithoutSelected[
index] ==
current,
onChanged: (_) { onChanged: (_) {
onTap(index); onTap(index);
}, },
@ -253,7 +255,9 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
children: [ children: [
Text( Text(
currenciesWithoutSelected[index], currenciesWithoutSelected[index],
key: (index == 0) key: (currenciesWithoutSelected[
index] ==
current)
? const Key( ? const Key(
"selectedCurrencySettingsCurrencyText") "selectedCurrencySettingsCurrencyText")
: null, : null,
@ -269,7 +273,9 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
currenciesWithoutSelected[ currenciesWithoutSelected[
index]] ?? index]] ??
"", "",
key: (index == 0) key: (currenciesWithoutSelected[
index] ==
current)
? const Key( ? const Key(
"selectedCurrencySettingsCurrencyTextDescription") "selectedCurrencySettingsCurrencyTextDescription")
: null, : null,