From 4d594e325182f724557698a4052c864be65a9218 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 16 Sep 2022 13:10:32 -0600 Subject: [PATCH] a couple small Coin enum fixes and added missing coin colors --- .../manage_nodes_views/manage_nodes_view.dart | 2 +- lib/utilities/cfcolors.dart | 7 +++++-- lib/utilities/enums/coin_enum.dart | 10 ++++----- pubspec.lock | 21 ++++++++++++++----- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart index 09b3ac752..140be8724 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart @@ -45,7 +45,7 @@ class _ManageNodesViewState extends ConsumerState { List coins = showTestNet ? _coins - : _coins.sublist(0, Coin.values.length - kTestNetCoinCount); + : _coins.sublist(0, _coins.length - kTestNetCoinCount); return Scaffold( backgroundColor: CFColors.almostWhite, diff --git a/lib/utilities/cfcolors.dart b/lib/utilities/cfcolors.dart index fefc9522a..8f460aa4e 100644 --- a/lib/utilities/cfcolors.dart +++ b/lib/utilities/cfcolors.dart @@ -6,12 +6,13 @@ class _CoinThemeColor { const _CoinThemeColor(); Color get bitcoin => const Color(0xFFFCC17B); - Color get bitcoincash => const Color(0xFFFCC17B); + Color get bitcoincash => const Color(0xFF7BCFB8); Color get firo => const Color(0xFFFF897A); Color get dogecoin => const Color(0xFFFFE079); Color get epicCash => const Color(0xFFC5C7CB); Color get monero => const Color(0xFFFF9E6B); - Color get namecoin => const Color(0xFFFCC17B); + Color get namecoin => const Color(0xFF91B1E1); + Color get wownero => const Color(0xFFED80C1); Color forCoin(Coin coin) { switch (coin) { @@ -33,6 +34,8 @@ class _CoinThemeColor { return monero; case Coin.namecoin: return namecoin; + // case Coin.wownero: + // return wownero; } } } diff --git a/lib/utilities/enums/coin_enum.dart b/lib/utilities/enums/coin_enum.dart index c39761f54..e0bc52433 100644 --- a/lib/utilities/enums/coin_enum.dart +++ b/lib/utilities/enums/coin_enum.dart @@ -1,12 +1,12 @@ import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as btc; +import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart' + as bch; import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart' as doge; import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart' as epic; import 'package:stackwallet/services/coins/firo/firo_wallet.dart' as firo; import 'package:stackwallet/services/coins/monero/monero_wallet.dart' as xmr; -import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart' - as bch; import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart' as nmc; @@ -30,7 +30,7 @@ enum Coin { } // remove firotestnet for now -const int kTestNetCoinCount = 2; +const int kTestNetCoinCount = 3; extension CoinExt on Coin { String get prettyName { @@ -52,7 +52,7 @@ extension CoinExt on Coin { case Coin.bitcoinTestNet: return "tBitcoin"; case Coin.bitcoincashTestnet: - return "tBitcoincash"; + return "tBitcoin Cash"; case Coin.firoTestNet: return "tFiro"; case Coin.dogecoinTestNet: @@ -193,7 +193,7 @@ Coin coinFromPrettyName(String name) { return Coin.bitcoinTestNet; case "Bitcoincash Testnet": - case "tBitcoincash": + case "tBitcoin Cash": case "Bitcoin Cash Testnet": return Coin.bitcoincashTestnet; case "Firo Testnet": diff --git a/pubspec.lock b/pubspec.lock index 836298786..0f9b29157 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -74,9 +74,11 @@ packages: bech32: dependency: "direct main" description: - name: bech32 - url: "https://pub.dartlang.org" - source: hosted + path: "." + ref: "22279d4bb24ed541b431acd269a1bc50af0f36a0" + resolved-ref: "22279d4bb24ed541b431acd269a1bc50af0f36a0" + url: "https://github.com/cypherstack/bech32.git" + source: git version: "0.2.1" bip32: dependency: "direct main" @@ -94,12 +96,21 @@ packages: url: "https://github.com/cypherstack/stack-bip39.git" source: git version: "1.0.6" + bitbox: + dependency: "direct main" + description: + path: "." + ref: ea65073efbaf395a5557e8cd7bd72f195cd7eb11 + resolved-ref: ea65073efbaf395a5557e8cd7bd72f195cd7eb11 + url: "https://github.com/Quppy/bitbox-flutter.git" + source: git + version: "1.0.1" bitcoindart: dependency: "direct main" description: path: "." - ref: a35968c2d2d900e77baa9f8b28c89b722c074039 - resolved-ref: a35968c2d2d900e77baa9f8b28c89b722c074039 + ref: "65eb920719c8f7895c5402a07497647e7fc4b346" + resolved-ref: "65eb920719c8f7895c5402a07497647e7fc4b346" url: "https://github.com/cypherstack/bitcoindart.git" source: git version: "3.0.1"