mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-27 06:18:50 +01:00
Merge branch 'dev' into cw-1497-transaction-history-improved-layout
This commit is contained in:
@@ -5,13 +5,12 @@ import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/address_formatter.dart';
|
||||
import 'package:cake_wallet/utils/clipboard_util.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
||||
import 'package:cw_core/payment_uris.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import "package:cw_core/wallet_type.dart";
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class L2SendExternalModal extends StatefulWidget {
|
||||
const L2SendExternalModal({super.key, required this.sendViewModel});
|
||||
@@ -180,11 +179,7 @@ class _L2SendExternalModalState extends State<L2SendExternalModal> {
|
||||
children: [
|
||||
Flexible(
|
||||
child: NewPrimaryButton(
|
||||
onPressed:(){
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: output.address),
|
||||
);
|
||||
},
|
||||
onPressed: () => ClipboardUtil.copyToClipboard(context, output.address),
|
||||
text: S.of(context).copy,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary),
|
||||
|
||||
@@ -227,13 +227,14 @@ class SendTransactionDetails extends StatelessWidget {
|
||||
decimals: 2)
|
||||
: sendViewModel.pendingTransactionFeeFiatAmountFormatted;
|
||||
|
||||
final showAddress = !sendViewModel.outputs.any((e) =>
|
||||
RegExp(AddressValidator.bolt11InvoiceMatcher).hasMatch(e.address.toLowerCase()) ||
|
||||
RegExp(AddressValidator.lnurlMatcher).hasMatch(e.address.toLowerCase()) ||
|
||||
(e.isParsedAddress &&
|
||||
e.parsedAddress.addresses.isNotEmpty &&
|
||||
RegExp(AddressValidator.lnurlMatcher)
|
||||
.hasMatch(e.parsedAddress.addresses.firstOrNull?.toLowerCase() ?? "")));
|
||||
final showAddress = !sendViewModel.outputs.any((e) =>
|
||||
RegExp(AddressValidator.bolt11InvoiceMatcher).hasMatch(e.address.toLowerCase()) ||
|
||||
RegExp(AddressValidator.lnurlMatcher).hasMatch(e.address.toLowerCase()) ||
|
||||
(e.isParsedAddress &&
|
||||
e.parsedAddress.parsedAddressByCurrencyMap[sendViewModel.selectedCryptoCurrency] != null &&
|
||||
e.parsedAddress.parsedAddressByCurrencyMap[sendViewModel.selectedCryptoCurrency]!.isNotEmpty &&
|
||||
RegExp(AddressValidator.lnurlMatcher)
|
||||
.hasMatch(e.parsedAddress.parsedAddressByCurrencyMap[sendViewModel.selectedCryptoCurrency]!.toLowerCase())));
|
||||
|
||||
final outputs = sendViewModel.outputs;
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/swap_page/swap_modal_header.dart';
|
||||
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
|
||||
import 'package:cake_wallet/utils/address_formatter.dart';
|
||||
import 'package:cake_wallet/utils/clipboard_util.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/payment_uris.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class SwapSendExternalModal extends StatefulWidget {
|
||||
const SwapSendExternalModal(
|
||||
@@ -45,7 +45,7 @@ class _SwapSendExternalModalState extends State<SwapSendExternalModal> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (uri == null) return SizedBox.shrink();
|
||||
if (widget.address.isEmpty) return SizedBox.shrink();
|
||||
final resolvedSize = MediaQuery.of(context).size.width * (largeQrMode ? 0.8 : 0.54);
|
||||
|
||||
return PopScope(
|
||||
@@ -139,7 +139,7 @@ class _SwapSendExternalModalState extends State<SwapSendExternalModal> {
|
||||
child: QrImage(
|
||||
size: animatedSize,
|
||||
embeddedImagePath: widget.from.iconPath,
|
||||
data: uri.toString(),
|
||||
data: uri?.toString() ?? widget.address,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -175,7 +175,7 @@ class _SwapSendExternalModalState extends State<SwapSendExternalModal> {
|
||||
children: [
|
||||
Flexible(
|
||||
child: NewPrimaryButton(
|
||||
onPressed: ()=> Clipboard.setData(ClipboardData(text:widget.address)),
|
||||
onPressed: () => ClipboardUtil.copyToClipboard(context, widget.address),
|
||||
text: S.of(context).copy,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary),
|
||||
|
||||
Reference in New Issue
Block a user