Merge pull request #100 from cake-tech/CAKE-299-UI-fixes-on-the-send-screen

CAKE-299 | fixed bug for estimatedFee getter in the send_view_model.dart
This commit is contained in:
M 2021-03-29 21:22:55 +03:00
commit e4bb14218b

View file

@ -79,14 +79,16 @@ abstract class SendViewModelBase with Store {
double get estimatedFee {
int amount;
try {
if (cryptoAmount?.isNotEmpty ?? false) {
final _cryptoAmount = cryptoAmount.replaceAll(',', '.');
int _amount = 0;
switch (walletType) {
case WalletType.monero:
_amount = moneroParseAmount(amount: cryptoAmount);
_amount = moneroParseAmount(amount: _cryptoAmount);
break;
case WalletType.bitcoin:
_amount = stringDoubleToBitcoinAmount(cryptoAmount);
_amount = stringDoubleToBitcoinAmount(_cryptoAmount);
break;
default:
break;
@ -107,6 +109,9 @@ abstract class SendViewModelBase with Store {
if (_wallet is MoneroWallet) {
return moneroAmountToDouble(amount: fee);
}
} catch (e) {
print(e.toString());
}
return 0;
}