fix: Payjoin button not showing (#2272)
Konstantin Ullrich committed
May 15, 2025 at 13:56 UTC
1b2e3f2ee1d069c20c57c7cb889cfd0dad8dd7fa
1 file changed
+22
-16
lib/src/screens/receive/widgets/qr_widget.dart
+22
-16
@@ -210,24 +210,30 @@ class QRWidget extends StatelessWidget {
210
),
211
),
212
),
213
- if (addressListViewModel.payjoinEndpoint.isNotEmpty) ...[
214
- Padding(
215
- padding: EdgeInsets.only(top: 12),
216
- child: PrimaryImageButton(
217
- onPressed: () {
218
- Clipboard.setData(ClipboardData(
219
- text: addressListViewModel.payjoinEndpoint));
220
- showBar<void>(context, S.of(context).copied_to_clipboard);
221
- },
222
- image: Image.asset('assets/images/payjoin.png', width: 25,),
223
- text: S.of(context).copy_payjoin_url,
224
- color: Theme.of(context).cardColor,
225
- textColor: Theme.of(context)
226
- .extension<CakeTextTheme>()!
227
- .buttonTextColor,
213
+ Observer(
214
+ builder: (_) => Offstage(
215
+ offstage: addressListViewModel.payjoinEndpoint.isEmpty,
216
+ child: Padding(
217
+ padding: EdgeInsets.only(top: 12),
218
+ child: PrimaryImageButton(
219
+ onPressed: () {
220
+ Clipboard.setData(
221
+ ClipboardData(text: addressUri.toString()));
222
+ showBar<void>(context, S.of(context).copied_to_clipboard);
223
+ },
224
+ image: Image.asset(
225
+ 'assets/images/payjoin.png',
226
+ width: 25,
227
+ ),
228
+ text: S.of(context).copy_payjoin_url,
229
+ color: Theme.of(context).cardColor,
230
+ textColor: Theme.of(context)
231
+ .extension<CakeTextTheme>()!
232
+ .buttonTextColor,
233
+ ),
234
),
235
),
230
- ],
236
+ ),
237
],
238
),
239
),