fix: wallets coin sorting matching Coin enum order

This commit is contained in:
julian 2023-06-19 13:59:46 -06:00
parent 724c1e7f16
commit f2e43bfaee

View file

@ -84,16 +84,11 @@ class Wallets extends ChangeNotifier {
}
final List<Tuple2<Coin, List<ChangeNotifierProvider<Manager>>>> result = [];
for (final coin in map.keys) {
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;
}