mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-02-02 19:26:27 +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,
|
+ ' ' + 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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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(
|
||||||
height: 1,
|
padding: EdgeInsets.only(top: 16, bottom: 8),
|
||||||
color: Theme.of(context).dividerColor,
|
child: Container(
|
||||||
|
height: 1,
|
||||||
|
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),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -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 =>
|
||||||
|
|
Loading…
Reference in a new issue