From f2e43bfaee046fe06e8b127817ad483552cac61a Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 19 Jun 2023 13:59:46 -0600 Subject: [PATCH] fix: wallets coin sorting matching Coin enum order --- lib/services/wallets.dart | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/services/wallets.dart b/lib/services/wallets.dart index 3ae837f44..8df8d2209 100644 --- a/lib/services/wallets.dart +++ b/lib/services/wallets.dart @@ -84,17 +84,12 @@ class Wallets extends ChangeNotifier { } final List>>> result = []; - for (final coin in map.keys) { - result.add(Tuple2(coin, map[coin]!)); + for (final coin in Coin.values) { + if (map[coin] != null) { + result.add(Tuple2(coin, map[coin]!)); + } } - // result.sort((a, b) => a.item1.prettyName.compareTo(b.item1.prettyName)); - result.sort((a, b) => a.item1.prettyName == "Bitcoin" - ? -1 - : b.item1.prettyName == "Monero" - ? 1 - : a.item1.prettyName.compareTo(b.item1.prettyName)); - return result; }