copy to clipboard

This commit is contained in:
Serhii 2023-12-15 15:54:05 +02:00
parent a75f2edf04
commit f08986efd6

View file

@ -2,10 +2,12 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/receive/widgets/address_list_item.dart';
import 'package:cake_wallet/src/widgets/search_bar_widget.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cw_bitcoin/bitcoin_address_record.dart';
import 'package:cw_bitcoin/electrum_wallet.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
class AddressListPage extends BasePage {
@ -84,8 +86,17 @@ class _AddressListBodyState extends State<AddressListBody> {
separatorBuilder: (_, __) => SizedBox(height: 15),
itemBuilder: (_, int index) {
final item = filteredAddresses[index];
return AddressListItem(
address: item.address, isChange: item.isHidden);
return GestureDetector(
onTap: () {
Clipboard.setData(ClipboardData(text: item.address));
showBar<void>(
context,
S.of(context).transaction_details_copied(
S.of(context).address));
},
child: AddressListItem(
address: item.address, isChange: item.isHidden),
);
},
),
),