diff --git a/lib/bitcoin/bitcoin_balance.dart b/lib/bitcoin/bitcoin_balance.dart index 1515b06ac..1f5a70b72 100644 --- a/lib/bitcoin/bitcoin_balance.dart +++ b/lib/bitcoin/bitcoin_balance.dart @@ -27,9 +27,9 @@ class BitcoinBalance extends Balance { final int confirmed; final int unconfirmed; - int get total => - (confirmed < 0 ? confirmed * -1 : confirmed) + - (unconfirmed < 0 ? unconfirmed * -1 : unconfirmed); + int get total => confirmed + unconfirmed; + + int get availableBalance => confirmed + (unconfirmed < 0 ? unconfirmed : 0); String get confirmedFormatted => bitcoinAmountToString(amount: confirmed); @@ -37,13 +37,16 @@ class BitcoinBalance extends Balance { String get totalFormatted => bitcoinAmountToString(amount: total); + String get availableBalanceFormatted => + bitcoinAmountToString(amount: availableBalance); + @override String formattedBalance(BalanceDisplayMode mode) { switch (mode) { case BalanceDisplayMode.fullBalance: return totalFormatted; case BalanceDisplayMode.availableBalance: - return confirmedFormatted; + return availableBalanceFormatted; default: return null; } diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index 28fc3da90..11e9fa863 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -45,7 +45,7 @@ Future defaultSettingsMigration( FiatCurrency.usd.toString()); await sharedPreferences.setInt( PreferencesKey.currentTransactionPriorityKey, - TransactionPriority.standart.raw); + TransactionPriority.standard.raw); await sharedPreferences.setInt( PreferencesKey.currentBalanceDisplayModeKey, BalanceDisplayMode.availableBalance.raw); diff --git a/lib/entities/transaction_priority.dart b/lib/entities/transaction_priority.dart index 08ea41951..b7661dbdc 100644 --- a/lib/entities/transaction_priority.dart +++ b/lib/entities/transaction_priority.dart @@ -18,7 +18,7 @@ class TransactionPriority extends EnumerableItem with Serializable { static const medium = TransactionPriority(title: 'Medium', raw: 2); static const fast = TransactionPriority(title: 'Fast', raw: 3); static const fastest = TransactionPriority(title: 'Fastest', raw: 4); - static const standart = slow; + static const standard = slow; static List forWalletType(WalletType type) { diff --git a/lib/entities/wallet_type.dart b/lib/entities/wallet_type.dart index f1a48ce52..ef4027a54 100644 --- a/lib/entities/wallet_type.dart +++ b/lib/entities/wallet_type.dart @@ -48,3 +48,14 @@ String walletTypeToString(WalletType type) { return ''; } } + +String walletTypeToDisplayName(WalletType type) { + switch (type) { + case WalletType.monero: + return 'Monero'; + case WalletType.bitcoin: + return 'Bitcoin (Electrum)'; + default: + return ''; + } +} diff --git a/lib/src/screens/dashboard/widgets/balance_page.dart b/lib/src/screens/dashboard/widgets/balance_page.dart index 69c4eae0b..17c283ae4 100644 --- a/lib/src/screens/dashboard/widgets/balance_page.dart +++ b/lib/src/screens/dashboard/widgets/balance_page.dart @@ -10,19 +10,20 @@ class BalancePage extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - padding: EdgeInsets.all(24), - child: GestureDetector( - onTapUp: (_) { - if (dashboardViewModel.balanceViewModel.canReverse) { - dashboardViewModel.balanceViewModel.isReversing = false; - } - }, - onTapDown: (_) { - if (dashboardViewModel.balanceViewModel.canReverse) { - dashboardViewModel.balanceViewModel.isReversing = true; - } - }, + return GestureDetector( + onTapUp: (_) { + if (dashboardViewModel.balanceViewModel.canReverse) { + dashboardViewModel.balanceViewModel.isReversing = false; + } + }, + onTapDown: (_) { + if (dashboardViewModel.balanceViewModel.canReverse) { + dashboardViewModel.balanceViewModel.isReversing = true; + } + }, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(24), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/src/screens/new_wallet/new_wallet_type_page.dart b/lib/src/screens/new_wallet/new_wallet_type_page.dart index 0924988d8..3cad1c504 100644 --- a/lib/src/screens/new_wallet/new_wallet_type_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_type_page.dart @@ -97,7 +97,7 @@ class WalletTypeFormState extends State { padding: EdgeInsets.only(top: 24), child: SelectButton( image: _iconFor(type), - text: walletTypeToString(type), + text: walletTypeToDisplayName(type), isSelected: selected == type, onTap: () => setState(() => selected = type)), )) diff --git a/lib/view_model/dashboard/balance_view_model.dart b/lib/view_model/dashboard/balance_view_model.dart index 62cbc430a..401351f13 100644 --- a/lib/view_model/dashboard/balance_view_model.dart +++ b/lib/view_model/dashboard/balance_view_model.dart @@ -95,7 +95,7 @@ abstract class BalanceViewModelBase with Store { if (_wallet is BitcoinWallet) { return WalletBalance( - unlockedBalance: _wallet.balance.confirmedFormatted, + unlockedBalance: _wallet.balance.availableBalanceFormatted, totalBalance: _wallet.balance.totalFormatted); }