mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
filter paired currency from all list
This commit is contained in:
parent
66e65736a5
commit
812897a3cb
1 changed files with 11 additions and 4 deletions
|
@ -160,17 +160,24 @@ class _ExchangeCurrencySelectionViewState
|
|||
}
|
||||
|
||||
List<Currency> filter(String text) {
|
||||
if (widget.pairedTicker == null) {
|
||||
if (text.isEmpty) {
|
||||
return _currencies;
|
||||
}
|
||||
|
||||
if (widget.pairedTicker == null) {
|
||||
return _currencies
|
||||
.where((e) =>
|
||||
e.name.toLowerCase().contains(text.toLowerCase()) ||
|
||||
e.ticker.toLowerCase().contains(text.toLowerCase()))
|
||||
.toList(growable: false);
|
||||
} else {
|
||||
if (text.isEmpty) {
|
||||
return _currencies
|
||||
.where((e) =>
|
||||
e.ticker.toLowerCase() != widget.pairedTicker!.toLowerCase())
|
||||
.toList(growable: false);
|
||||
}
|
||||
|
||||
return _currencies
|
||||
.where((e) =>
|
||||
e.ticker.toLowerCase() != widget.pairedTicker!.toLowerCase() &&
|
||||
|
|
Loading…
Reference in a new issue