CAKE-103 | added hasRefundAddress parameter to exchange card; applied refund address to deposit card on the exchange page
OleksandrSobol committed
Oct 2, 2020 at 18:49 UTC
468ad82b37d868bb358ee1d271f051943525542f
3 files changed
+17
-14
lib/src/screens/exchange/exchange_page.dart
+1
@@ -173,6 +173,7 @@ class ExchangePage extends BasePage {
173
initialIsAddressEditable:
174
exchangeViewModel.isDepositAddressEnabled,
175
isAmountEstimated: false,
176
+ hasRefundAddress: true,
177
currencies: CryptoCurrency.all,
178
onCurrencySelected: (currency) =>
179
exchangeViewModel.changeDepositCurrency(
lib/src/screens/exchange/widgets/exchange_card.dart
+14
-12
@@ -18,6 +18,7 @@ class ExchangeCard extends StatefulWidget {
18
this.initialIsAmountEditable,
19
this.initialIsAddressEditable,
20
this.isAmountEstimated,
21
+ this.hasRefundAddress = false,
22
this.currencies,
23
this.onCurrencySelected,
24
this.imageArrow,
@@ -38,6 +39,7 @@ class ExchangeCard extends StatefulWidget {
39
final bool initialIsAmountEditable;
40
final bool initialIsAddressEditable;
41
final bool isAmountEstimated;
42
+ final bool hasRefundAddress;
43
final Image imageArrow;
44
final Color currencyButtonColor;
45
final Color addressButtonsColor;
@@ -228,18 +230,18 @@ class ExchangeCardState extends State<ExchangeCard> {
230
: Offstage(),
231
]),
232
),
231
- _isAddressEditable
232
- ? Offstage()
233
- : Padding(
234
- padding: EdgeInsets.only(top: 20),
235
- child: Text(
236
- S.of(context).refund_address,
237
- style: TextStyle(
238
- fontSize: 14,
239
- fontWeight: FontWeight.w500,
240
- color:
241
- Theme.of(context).textTheme.subhead.decorationColor),
242
- )),
233
+ !_isAddressEditable && widget.hasRefundAddress
234
+ ? Padding(
235
+ padding: EdgeInsets.only(top: 20),
236
+ child: Text(
237
+ S.of(context).refund_address,
238
+ style: TextStyle(
239
+ fontSize: 14,
240
+ fontWeight: FontWeight.w500,
241
+ color:
242
+ Theme.of(context).textTheme.subhead.decorationColor),
243
+ ))
244
+ : Offstage(),
245
_isAddressEditable
246
? Padding(
247
padding: EdgeInsets.only(top: 20),
lib/utils/show_pop_up.dart
+2
-2
@@ -14,8 +14,8 @@ Future<T> showPopUp<T>({
14
context: context,
15
builder: builder,
16
barrierDismissible: barrierDismissible,
17
- //barrierColor: barrierColor,
18
- //useSafeArea: useSafeArea,
17
+ barrierColor: barrierColor,
18
+ useSafeArea: useSafeArea,
19
useRootNavigator: useRootNavigator,
20
routeSettings: routeSettings,
21
child: child);