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
OleksandrSobol committed
Dec 30, 2020 at 16:54 UTC
823e9d11ae631c526d08aac8a5e13dabf234f5a3
4 files changed
+29
-10
lib/src/screens/send/send_page.dart
+2
-2
@@ -628,8 +628,8 @@ class SendPage extends BasePage {
628
+ ' ' + sendViewModel.fiat.title,
629
fee: S.of(context).send_fee,
630
feeValue: sendViewModel.pendingTransaction.feeFormatted,
631
- transactionPriority: sendViewModel
632
- .transactionPriority.toString(),
631
+ feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmount
632
+ + ' ' + sendViewModel.fiat.title,
633
recipientTitle: 'Recipient address',
634
recipientAddress: sendViewModel.address,
635
rightButtonText: S.of(context).ok,
lib/src/screens/send/widgets/confirm_sending_alert.dart
+3
-3
@@ -10,7 +10,7 @@ class ConfirmSendingAlert extends BaseAlertDialog {
10
@required this.fiatAmountValue,
11
@required this.fee,
12
@required this.feeValue,
13
- @required this.transactionPriority,
13
+ @required this.feeFiatAmount,
14
@required this.recipientTitle,
15
@required this.recipientAddress,
16
@required this.leftButtonText,
@@ -26,7 +26,7 @@ class ConfirmSendingAlert extends BaseAlertDialog {
26
final String fiatAmountValue;
27
final String fee;
28
final String feeValue;
29
- final String transactionPriority;
29
+ final String feeFiatAmount;
30
final String recipientTitle;
31
final String recipientAddress;
32
final String leftButtonText;
@@ -133,7 +133,7 @@ class ConfirmSendingAlert extends BaseAlertDialog {
133
),
134
),
135
Text(
136
- transactionPriority,
136
+ feeFiatAmount,
137
style: TextStyle(
138
fontSize: 12,
139
fontWeight: FontWeight.w600,
lib/src/widgets/base_alert_dialog.dart
+8
-5
@@ -132,17 +132,20 @@ class BaseAlertDialog extends StatelessWidget {
132
crossAxisAlignment: CrossAxisAlignment.center,
133
children: <Widget>[
134
Padding(
135
- padding: EdgeInsets.fromLTRB(24, 32, 24, 16),
135
+ padding: EdgeInsets.fromLTRB(24, 32, 24, 0),
136
child: title(context),
137
),
138
isDividerExists
139
- ? Container(
140
- height: 1,
141
- color: Theme.of(context).dividerColor,
139
+ ? Padding(
140
+ padding: EdgeInsets.only(top: 16, bottom: 8),
141
+ child: Container(
142
+ height: 1,
143
+ color: Theme.of(context).dividerColor,
144
+ ),
145
)
146
: Offstage(),
147
Padding(
145
- padding: EdgeInsets.fromLTRB(24, 16, 24, 32),
148
+ padding: EdgeInsets.fromLTRB(24, 8, 24, 32),
149
child: content(context),
150
)
151
],
lib/view_model/send/send_view_model.dart
+16
@@ -89,6 +89,22 @@ abstract class SendViewModelBase with Store {
89
}
90
}
91
92
+ @computed
93
+ String get pendingTransactionFeeFiatAmount {
94
+ try {
95
+ if (pendingTransaction != null) {
96
+ final fiat = calculateFiatAmount(
97
+ price: _fiatConversationStore.prices[_wallet.currency],
98
+ cryptoAmount: pendingTransaction.feeFormatted);
99
+ return fiat;
100
+ } else {
101
+ return '0.00';
102
+ }
103
+ } catch (_) {
104
+ return '0.00';
105
+ }
106
+ }
107
+
108
FiatCurrency get fiat => _settingsStore.fiatCurrency;
109
110
TransactionPriority get transactionPriority =>