From 93d544809c77a515552f67d834f4db277e36ab2b Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 9 Jul 2024 14:29:34 -0500 Subject: [PATCH] fix spacing on wallet settings view --- .../wallet_settings_wallet_settings_view.dart | 102 ++++++++++-------- 1 file changed, 57 insertions(+), 45 deletions(-) diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart index 02001a277..cb572a72c 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart @@ -21,6 +21,7 @@ import '../../../../utilities/util.dart'; import '../../../../wallets/isar/models/wallet_info.dart'; import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/lelantus_interface.dart'; +import '../../../../wallets/wallet/wallet_mixin_interfaces/multi_address_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/rbf_interface.dart'; import '../../../../wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; import '../../../../widgets/background.dart'; @@ -220,52 +221,63 @@ class _WalletSettingsWalletSettingsViewState ), ), ), - const SizedBox( - height: 8, - ), - RoundedWhiteContainer( - child: Consumer( - builder: (_, ref, __) { - return RawMaterialButton( - // splashColor: Theme.of(context).extension()!.highlight, - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), - ), - onPressed: null, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Reuse receiving address by default", - style: STextStyles.titleBold12(context), - textAlign: TextAlign.left, - ), - SizedBox( - height: 20, - width: 40, - child: DraggableSwitchButton( - isOn: ref.watch( - pWalletInfo(widget.walletId) - .select((value) => value.otherData), - )[WalletInfoKeys.reuseAddress] as bool? ?? - false, - onValueChanged: (newValue) { - _switchReuseAddressToggled(newValue); - }, - ), - ), - ], - ), - ), - ); - }, + if (ref.watch(pWallets).getWallet(widget.walletId) + is RbfInterface) + const SizedBox( + height: 8, + ), + if (ref.watch(pWallets).getWallet(widget.walletId) + is MultiAddressInterface) + RoundedWhiteContainer( + child: Consumer( + builder: (_, ref, __) { + return RawMaterialButton( + // splashColor: Theme.of(context).extension()!.highlight, + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + onPressed: null, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Reuse receiving address by default", + style: STextStyles.titleBold12(context), + textAlign: TextAlign.left, + ), + SizedBox( + height: 20, + width: 40, + child: DraggableSwitchButton( + isOn: ref.watch( + pWalletInfo(widget.walletId).select( + (value) => value.otherData), + )[WalletInfoKeys.reuseAddress] + as bool? ?? + false, + onValueChanged: (newValue) { + _switchReuseAddressToggled(newValue); + }, + ), + ), + ], + ), + ), + ); + }, + ), + ), + if (ref.watch(pWallets).getWallet(widget.walletId) + is MultiAddressInterface) + const SizedBox( + height: 8, ), - ), if (ref.watch(pWallets).getWallet(widget.walletId) is LelantusInterface) const SizedBox(