Merge pull request #115 from cake-tech/CAKE-103-change-refund-address-position-on-exchange-screen

Cake 103 change refund address position on exchange screen
This commit is contained in:
M 2020-10-06 14:40:41 +03:00
commit 7aacfb55fa
2 changed files with 17 additions and 12 deletions

View file

@ -173,6 +173,7 @@ class ExchangePage extends BasePage {
initialIsAddressEditable:
exchangeViewModel.isDepositAddressEnabled,
isAmountEstimated: false,
hasRefundAddress: true,
currencies: CryptoCurrency.all,
onCurrencySelected: (currency) =>
exchangeViewModel.changeDepositCurrency(

View file

@ -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,9 +230,8 @@ class ExchangeCardState extends State<ExchangeCard> {
: Offstage(),
]),
),
_isAddressEditable
? Offstage()
: Padding(
!_isAddressEditable && widget.hasRefundAddress
? Padding(
padding: EdgeInsets.only(top: 20),
child: Text(
S.of(context).refund_address,
@ -239,12 +240,15 @@ class ExchangeCardState extends State<ExchangeCard> {
fontWeight: FontWeight.w500,
color:
Theme.of(context).textTheme.subhead.decorationColor),
)),
))
: Offstage(),
_isAddressEditable
? Padding(
padding: EdgeInsets.only(top: 20),
child: AddressTextField(
controller: addressController,
placeholder: widget.hasRefundAddress
? S.of(context).refund_address : null,
options: [
AddressTextFieldOption.paste,
AddressTextFieldOption.qrCode,