mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 13:14:32 +00:00
desktop nodes search
This commit is contained in:
parent
1afc468d28
commit
6cfbeb180e
1 changed files with 14 additions and 0 deletions
|
@ -34,6 +34,18 @@ class _NodesSettings extends ConsumerState<NodesSettings> {
|
||||||
|
|
||||||
String filter = "";
|
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
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_coins = _coins.toList();
|
_coins = _coins.toList();
|
||||||
|
@ -68,6 +80,8 @@ class _NodesSettings extends ConsumerState<NodesSettings> {
|
||||||
? _coins
|
? _coins
|
||||||
: _coins.sublist(0, _coins.length - kTestNetCoinCount);
|
: _coins.sublist(0, _coins.length - kTestNetCoinCount);
|
||||||
|
|
||||||
|
coins = _search(filter, coins);
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|
Loading…
Reference in a new issue