From 1b2e3f2ee1d069c20c57c7cb889cfd0dad8dd7fa Mon Sep 17 00:00:00 2001 From: Konstantin Ullrich Date: Thu, 15 May 2025 13:56:43 +0200 Subject: [PATCH] fix: Payjoin button not showing (#2272) --- .../screens/receive/widgets/qr_widget.dart | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/src/screens/receive/widgets/qr_widget.dart b/lib/src/screens/receive/widgets/qr_widget.dart index 5c0b12e38..1f3f4a88e 100644 --- a/lib/src/screens/receive/widgets/qr_widget.dart +++ b/lib/src/screens/receive/widgets/qr_widget.dart @@ -210,24 +210,30 @@ class QRWidget extends StatelessWidget { ), ), ), - if (addressListViewModel.payjoinEndpoint.isNotEmpty) ...[ - Padding( - padding: EdgeInsets.only(top: 12), - child: PrimaryImageButton( - onPressed: () { - Clipboard.setData(ClipboardData( - text: addressListViewModel.payjoinEndpoint)); - showBar(context, S.of(context).copied_to_clipboard); - }, - image: Image.asset('assets/images/payjoin.png', width: 25,), - text: S.of(context).copy_payjoin_url, - color: Theme.of(context).cardColor, - textColor: Theme.of(context) - .extension()! - .buttonTextColor, + Observer( + builder: (_) => Offstage( + offstage: addressListViewModel.payjoinEndpoint.isEmpty, + child: Padding( + padding: EdgeInsets.only(top: 12), + child: PrimaryImageButton( + onPressed: () { + Clipboard.setData( + ClipboardData(text: addressUri.toString())); + showBar(context, S.of(context).copied_to_clipboard); + }, + image: Image.asset( + 'assets/images/payjoin.png', + width: 25, + ), + text: S.of(context).copy_payjoin_url, + color: Theme.of(context).cardColor, + textColor: Theme.of(context) + .extension()! + .buttonTextColor, + ), ), ), - ], + ), ], ), ),