CAKE-221 | added pendingTransactionFeeFiatAmount getter to send_view_model.dart; applied feeFiatAmount property instead transactionPriority in the confirm_sending_alert.dart; fixed base_alert_dialog.dart

This commit is contained in:
OleksandrSobol 2020-12-30 16:54:55 +02:00
parent ac1709bffb
commit 823e9d11ae
4 changed files with 29 additions and 10 deletions

View file

@ -628,8 +628,8 @@ class SendPage extends BasePage {
+ ' ' + sendViewModel.fiat.title, + ' ' + sendViewModel.fiat.title,
fee: S.of(context).send_fee, fee: S.of(context).send_fee,
feeValue: sendViewModel.pendingTransaction.feeFormatted, feeValue: sendViewModel.pendingTransaction.feeFormatted,
transactionPriority: sendViewModel feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmount
.transactionPriority.toString(), + ' ' + sendViewModel.fiat.title,
recipientTitle: 'Recipient address', recipientTitle: 'Recipient address',
recipientAddress: sendViewModel.address, recipientAddress: sendViewModel.address,
rightButtonText: S.of(context).ok, rightButtonText: S.of(context).ok,

View file

@ -10,7 +10,7 @@ class ConfirmSendingAlert extends BaseAlertDialog {
@required this.fiatAmountValue, @required this.fiatAmountValue,
@required this.fee, @required this.fee,
@required this.feeValue, @required this.feeValue,
@required this.transactionPriority, @required this.feeFiatAmount,
@required this.recipientTitle, @required this.recipientTitle,
@required this.recipientAddress, @required this.recipientAddress,
@required this.leftButtonText, @required this.leftButtonText,
@ -26,7 +26,7 @@ class ConfirmSendingAlert extends BaseAlertDialog {
final String fiatAmountValue; final String fiatAmountValue;
final String fee; final String fee;
final String feeValue; final String feeValue;
final String transactionPriority; final String feeFiatAmount;
final String recipientTitle; final String recipientTitle;
final String recipientAddress; final String recipientAddress;
final String leftButtonText; final String leftButtonText;
@ -133,7 +133,7 @@ class ConfirmSendingAlert extends BaseAlertDialog {
), ),
), ),
Text( Text(
transactionPriority, feeFiatAmount,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

View file

@ -132,17 +132,20 @@ class BaseAlertDialog extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.fromLTRB(24, 32, 24, 16), padding: EdgeInsets.fromLTRB(24, 32, 24, 0),
child: title(context), child: title(context),
), ),
isDividerExists isDividerExists
? Container( ? Padding(
padding: EdgeInsets.only(top: 16, bottom: 8),
child: Container(
height: 1, height: 1,
color: Theme.of(context).dividerColor, color: Theme.of(context).dividerColor,
),
) )
: Offstage(), : Offstage(),
Padding( Padding(
padding: EdgeInsets.fromLTRB(24, 16, 24, 32), padding: EdgeInsets.fromLTRB(24, 8, 24, 32),
child: content(context), child: content(context),
) )
], ],

View file

@ -89,6 +89,22 @@ abstract class SendViewModelBase with Store {
} }
} }
@computed
String get pendingTransactionFeeFiatAmount {
try {
if (pendingTransaction != null) {
final fiat = calculateFiatAmount(
price: _fiatConversationStore.prices[_wallet.currency],
cryptoAmount: pendingTransaction.feeFormatted);
return fiat;
} else {
return '0.00';
}
} catch (_) {
return '0.00';
}
}
FiatCurrency get fiat => _settingsStore.fiatCurrency; FiatCurrency get fiat => _settingsStore.fiatCurrency;
TransactionPriority get transactionPriority => TransactionPriority get transactionPriority =>