From 85bb70807c12a656cf984697787c2972fb73cefc Mon Sep 17 00:00:00 2001 From: Konstantin Ullrich Date: Mon, 20 Jul 2026 16:27:23 +0200 Subject: [PATCH] fix: copy button behavior on receive page (#3424) --- .../receive_page/receive_bottom_buttons.dart | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/lib/new-ui/widgets/receive_page/receive_bottom_buttons.dart b/lib/new-ui/widgets/receive_page/receive_bottom_buttons.dart index 3d7cb1f9f..1566ff88d 100644 --- a/lib/new-ui/widgets/receive_page/receive_bottom_buttons.dart +++ b/lib/new-ui/widgets/receive_page/receive_bottom_buttons.dart @@ -1,22 +1,10 @@ -import 'dart:io'; - -import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/new-ui/widgets/modern_button.dart'; -import 'package:device_info_plus/device_info_plus.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:cake_wallet/new-ui/widgets/copy_wrapper.dart'; +import "package:cake_wallet/generated/i18n.dart"; +import "package:cake_wallet/new-ui/widgets/copy_wrapper.dart"; +import "package:cake_wallet/new-ui/widgets/modern_button.dart"; +import "package:flutter/material.dart"; +import "package:flutter/services.dart"; class ReceiveBottomButtons extends StatefulWidget { - final bool largeQrMode; - final ClipboardData? copyData; - final VoidCallback onCopyButtonPressed; - final VoidCallback onAmountButtonPressed; - final VoidCallback onLabelButtonPressed; - final VoidCallback onAccountsButtonPressed; - final bool showLabelButton; - final bool showAccountsButton; - const ReceiveBottomButtons({ required this.largeQrMode, required this.onCopyButtonPressed, @@ -29,6 +17,15 @@ class ReceiveBottomButtons extends StatefulWidget { super.key, }); + final bool largeQrMode; + final ClipboardData? copyData; + final VoidCallback onCopyButtonPressed; + final VoidCallback onAmountButtonPressed; + final VoidCallback onLabelButtonPressed; + final VoidCallback onAccountsButtonPressed; + final bool showLabelButton; + final bool showAccountsButton; + @override State createState() => _ReceiveBottomButtonsState(); } @@ -49,7 +46,7 @@ class _ReceiveBottomButtonsState extends State { opacity: targetOpacity, curve: Curves.easeOut, child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 32.0), + padding: const EdgeInsets.symmetric(horizontal: 32), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, @@ -57,12 +54,13 @@ class _ReceiveBottomButtonsState extends State { children: [ GestureDetector( onTap: widget.copyData == null ? widget.onCopyButtonPressed : null, + behavior: HitTestBehavior.opaque, child: IgnorePointer( ignoring: widget.copyData == null, child: CopyWrapper( data: widget.copyData, builder: (context, copied) => AnimatedSwitcher( - duration: Duration(milliseconds: 200), + duration: const Duration(milliseconds: 200), child: IgnorePointer( child: ModernButton.svg( key: ValueKey(copied), @@ -84,25 +82,28 @@ class _ReceiveBottomButtonsState extends State { ), ), ModernButton.svg( - size: 60, - iconSize: 32, - svgPath: "assets/new-ui/set-amount.svg", - onPressed: widget.onAmountButtonPressed, - label: S.of(context).set_amount), + size: 60, + iconSize: 32, + svgPath: "assets/new-ui/set-amount.svg", + onPressed: widget.onAmountButtonPressed, + label: S.of(context).set_amount, + ), if (widget.showLabelButton) ModernButton.svg( - size: 60, - iconSize: 32, - svgPath: "assets/new-ui/add-label.svg", - onPressed: widget.onLabelButtonPressed, - label: S.of(context).label), + size: 60, + iconSize: 32, + svgPath: "assets/new-ui/add-label.svg", + onPressed: widget.onLabelButtonPressed, + label: S.of(context).label, + ), if (widget.showAccountsButton) ModernButton.svg( - size: 60, - iconSize: 32, - svgPath: "assets/new-ui/addr-book.svg", - onPressed: widget.onAccountsButtonPressed, - label: S.of(context).addresses), + size: 60, + iconSize: 32, + svgPath: "assets/new-ui/addr-book.svg", + onPressed: widget.onAccountsButtonPressed, + label: S.of(context).addresses, + ), ], ), ),