mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-23 11:15:33 +00:00
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:
parent
ac1709bffb
commit
823e9d11ae
4 changed files with 29 additions and 10 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
)
|
||||
],
|
||||
|
|
|
@ -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 =>
|
||||
|
|
Loading…
Reference in a new issue