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,
fee: S.of(context).send_fee,
feeValue: sendViewModel.pendingTransaction.feeFormatted,
transactionPriority: sendViewModel
.transactionPriority.toString(),
feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmount
+ ' ' + sendViewModel.fiat.title,
recipientTitle: 'Recipient address',
recipientAddress: sendViewModel.address,
rightButtonText: S.of(context).ok,

View file

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

View file

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