From 468ad82b37d868bb358ee1d271f051943525542f Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Fri, 2 Oct 2020 18:49:45 +0300 Subject: [PATCH] CAKE-103 | added hasRefundAddress parameter to exchange card; applied refund address to deposit card on the exchange page --- lib/src/screens/exchange/exchange_page.dart | 1 + .../exchange/widgets/exchange_card.dart | 26 ++++++++++--------- lib/utils/show_pop_up.dart | 4 +-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lib/src/screens/exchange/exchange_page.dart b/lib/src/screens/exchange/exchange_page.dart index 694f74129..ab154a98d 100644 --- a/lib/src/screens/exchange/exchange_page.dart +++ b/lib/src/screens/exchange/exchange_page.dart @@ -173,6 +173,7 @@ class ExchangePage extends BasePage { initialIsAddressEditable: exchangeViewModel.isDepositAddressEnabled, isAmountEstimated: false, + hasRefundAddress: true, currencies: CryptoCurrency.all, onCurrencySelected: (currency) => exchangeViewModel.changeDepositCurrency( diff --git a/lib/src/screens/exchange/widgets/exchange_card.dart b/lib/src/screens/exchange/widgets/exchange_card.dart index 7706e7271..f21c88082 100644 --- a/lib/src/screens/exchange/widgets/exchange_card.dart +++ b/lib/src/screens/exchange/widgets/exchange_card.dart @@ -18,6 +18,7 @@ class ExchangeCard extends StatefulWidget { this.initialIsAmountEditable, this.initialIsAddressEditable, this.isAmountEstimated, + this.hasRefundAddress = false, this.currencies, this.onCurrencySelected, this.imageArrow, @@ -38,6 +39,7 @@ class ExchangeCard extends StatefulWidget { final bool initialIsAmountEditable; final bool initialIsAddressEditable; final bool isAmountEstimated; + final bool hasRefundAddress; final Image imageArrow; final Color currencyButtonColor; final Color addressButtonsColor; @@ -228,18 +230,18 @@ class ExchangeCardState extends State { : Offstage(), ]), ), - _isAddressEditable - ? Offstage() - : Padding( - padding: EdgeInsets.only(top: 20), - child: Text( - S.of(context).refund_address, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: - Theme.of(context).textTheme.subhead.decorationColor), - )), + !_isAddressEditable && widget.hasRefundAddress + ? Padding( + padding: EdgeInsets.only(top: 20), + child: Text( + S.of(context).refund_address, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: + Theme.of(context).textTheme.subhead.decorationColor), + )) + : Offstage(), _isAddressEditable ? Padding( padding: EdgeInsets.only(top: 20), diff --git a/lib/utils/show_pop_up.dart b/lib/utils/show_pop_up.dart index 280bcff3c..a97fb3762 100644 --- a/lib/utils/show_pop_up.dart +++ b/lib/utils/show_pop_up.dart @@ -14,8 +14,8 @@ Future showPopUp({ context: context, builder: builder, barrierDismissible: barrierDismissible, - //barrierColor: barrierColor, - //useSafeArea: useSafeArea, + barrierColor: barrierColor, + useSafeArea: useSafeArea, useRootNavigator: useRootNavigator, routeSettings: routeSettings, child: child);