desktop nodes search

This commit is contained in:
julian 2022-11-15 15:51:53 -06:00
parent 1afc468d28
commit 6cfbeb180e

View file

@ -34,6 +34,18 @@ class _NodesSettings extends ConsumerState<NodesSettings> {
String filter = "";
List<Coin> _search(String filter, List<Coin> coins) {
if (filter.isEmpty) {
return coins;
}
return coins
.where((coin) =>
coin.prettyName.contains(filter) ||
coin.name.contains(filter) ||
coin.ticker.toLowerCase().contains(filter.toLowerCase()))
.toList();
}
@override
void initState() {
_coins = _coins.toList();
@ -68,6 +80,8 @@ class _NodesSettings extends ConsumerState<NodesSettings> {
? _coins
: _coins.sublist(0, _coins.length - kTestNetCoinCount);
coins = _search(filter, coins);
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [