diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart index 498928853..88288506e 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart @@ -12,6 +12,7 @@ import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; @@ -33,10 +34,8 @@ enum _WalletOptions { } class WalletOptionsButton extends ConsumerStatefulWidget { - const WalletOptionsButton({ - Key? key, - required this.walletId, - }) : super(key: key); + const WalletOptionsButton({Key? key, required this.walletId}) + : super(key: key); final String walletId; @@ -47,10 +46,12 @@ class WalletOptionsButton extends ConsumerStatefulWidget { class _WalletOptionsButtonState extends ConsumerState { late final String walletId; + late final Coin coin; @override void initState() { walletId = widget.walletId; + coin = ref.read(walletsChangeNotifierProvider).getManager(walletId).coin; super.initState(); } @@ -80,6 +81,7 @@ class _WalletOptionsButtonState extends ConsumerState { onShowXpubPressed: () async { Navigator.of(context).pop(_WalletOptions.showXpub); }, + coin: coin, ); }, ); @@ -186,14 +188,19 @@ class WalletOptionsPopupMenu extends StatelessWidget { required this.onDeletePressed, required this.onAddressListPressed, required this.onShowXpubPressed, + required this.coin, }) : super(key: key); final VoidCallback onDeletePressed; final VoidCallback onAddressListPressed; final VoidCallback onShowXpubPressed; + final Coin coin; @override Widget build(BuildContext context) { + final bool xpubEnabled = + coin != Coin.monero && coin != Coin.epicCash && coin != Coin.wownero; + return Stack( children: [ Positioned( @@ -247,41 +254,43 @@ class WalletOptionsPopupMenu extends StatelessWidget { ), ), ), - const SizedBox( - height: 8, - ), - TransparentButton( - onPressed: onShowXpubPressed, - child: Padding( - padding: const EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SvgPicture.asset( - Assets.svg.eye, - width: 20, - height: 20, - color: Theme.of(context) - .extension()! - .textFieldActiveSearchIconLeft, - ), - const SizedBox(width: 14), - Expanded( - child: Text( - _WalletOptions.showXpub.prettyName, - style: STextStyles.desktopTextExtraExtraSmall( - context) - .copyWith( - color: Theme.of(context) - .extension()! - .textDark, + if (xpubEnabled) + const SizedBox( + height: 8, + ), + if (xpubEnabled) + TransparentButton( + onPressed: onShowXpubPressed, + child: Padding( + padding: const EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.asset( + Assets.svg.eye, + width: 20, + height: 20, + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconLeft, + ), + const SizedBox(width: 14), + Expanded( + child: Text( + _WalletOptions.showXpub.prettyName, + style: STextStyles.desktopTextExtraExtraSmall( + context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark, + ), ), ), - ), - ], + ], + ), ), ), - ), const SizedBox( height: 8, ),