mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
Send-success art: replace the Cake birthday cake with a Hash Bags money sack that has a # on it and erupts #/$/₿ (assets/images/hash_bag.png). Used by the success page, send-confirm sheet, exchange-trade, and dEURO savings. Asset renames (files + refs): - birthday_cake.png -> hash_bag.png - restore_cupcake(.png/_dark) -> restore_hashbag.png - qr-cake.png -> qr-hashbag.png - arrow_bottom_cake_green.png -> arrow_bottom_green.png (+ 2.0x/3.0x) Identifier renames: - CakeImageWidget -> HashImageWidget (widget + file + 93 refs) - typography _cakeRegular/_cakeBold/_cakeSemiBold -> _hash* Transaction filter: drop the Cake Pay "Orders" row and every non-Trocador trade provider; the swap gate is already Trocador-only, so this just aligns the filter UI with reality. Android launcher: add breathing room to the adaptive-foreground # (all densities, monochrome included); iOS icon unchanged. About page: swap the Cake easter eggs for Hash Bags ones. Deferred (needs a build to verify): new-ui .svg.vec filename renames (cake_squircle_icon, cakewallet-wordmark, cake-setting) — already Hash Bags in content, only the filenames are cake, and they route through the .vec precompile.
213 lines
9.2 KiB
Dart
213 lines
9.2 KiB
Dart
import 'package:hash_wallet/bitcoin/bitcoin.dart';
|
|
import 'package:hash_wallet/generated/i18n.dart';
|
|
import 'package:hash_wallet/new-ui/widgets/new_primary_button.dart';
|
|
import 'package:hash_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
|
import 'package:hash_wallet/src/screens/receive/widgets/qr_image.dart';
|
|
import 'package:hash_wallet/src/widgets/hash_image_widget.dart';
|
|
import 'package:hash_wallet/utils/address_formatter.dart';
|
|
import 'package:hash_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});
|
|
|
|
final SendViewModel sendViewModel;
|
|
|
|
@override
|
|
State<L2SendExternalModal> createState() => _L2SendExternalModalState();
|
|
}
|
|
|
|
class _L2SendExternalModalState extends State<L2SendExternalModal> {
|
|
PaymentURI? uri;
|
|
bool largeQrMode = false;
|
|
static const warningTextColor = Color(0xFFFFB84E);
|
|
static const warningBackgroundColor = Color(0xFF8E5800);
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
() async {
|
|
if (widget.sendViewModel.wallet.type == WalletType.bitcoin) {
|
|
await bitcoin!.setAddressType(widget.sendViewModel.wallet,
|
|
bitcoin!.getOptionToType(bitcoin!.getBitcoinLightningReceivePageOption()));
|
|
} else if(widget.sendViewModel.wallet.type == WalletType.litecoin) {
|
|
await bitcoin!.setAddressType(widget.sendViewModel.wallet,
|
|
bitcoin!.getOptionToType(bitcoin!.getLitecoinMwebReceivePageOption()));
|
|
}
|
|
final newUri = await widget.sendViewModel.wallet.walletAddresses
|
|
.getPaymentRequestUri(widget.sendViewModel.outputs.first.cryptoAmount);
|
|
setState(() {
|
|
uri = newUri;
|
|
});
|
|
}.call();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final output = widget.sendViewModel.outputs.first;
|
|
final resolvedSize = MediaQuery.of(context).size.width * (largeQrMode ? 0.8 : 0.54);
|
|
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).colorScheme.surface,
|
|
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
ModalTopBar(
|
|
title: "",
|
|
leadingWidget: Row(
|
|
spacing: 12,
|
|
children: [
|
|
if(widget.sendViewModel.walletType == WalletType.bitcoin)
|
|
HashImageWidget(imageUrl:"assets/new-ui/lightning_deposit_help.svg", height: 36),
|
|
Text(
|
|
S.of(context).bitcoin_lightning_deposit,
|
|
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 20),
|
|
)
|
|
],
|
|
),
|
|
trailingIcon: Icon(Icons.close),
|
|
onTrailingPressed: Navigator.of(context).pop,
|
|
),
|
|
SafeArea(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 18.0),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Column(
|
|
spacing: 24,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
spacing: 12,
|
|
children: [
|
|
Text(
|
|
S.of(context).send_exactly,
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
color: Theme.of(context).colorScheme.onSurface,
|
|
fontWeight: FontWeight.w500),
|
|
),
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
borderRadius: BorderRadius.circular(12)),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Row(
|
|
spacing: 8,
|
|
children: [
|
|
Text(
|
|
output.cryptoAmount,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w500,
|
|
fontSize: 16,
|
|
color: Theme.of(context).colorScheme.primary),
|
|
),
|
|
Text(
|
|
widget.sendViewModel.currency.title,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontSize: 16,
|
|
color: Theme.of(context).colorScheme.primary),
|
|
),
|
|
],
|
|
),
|
|
)),
|
|
Text("${S.of(context).to}:",
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
color: Theme.of(context).colorScheme.onSurface,
|
|
fontWeight: FontWeight.w500))
|
|
],
|
|
),
|
|
uri == null
|
|
? Container(
|
|
width: resolvedSize,
|
|
height: resolvedSize,
|
|
child: CupertinoActivityIndicator(),
|
|
)
|
|
: GestureDetector(
|
|
onTap: () {
|
|
setState(() {
|
|
largeQrMode = !largeQrMode;
|
|
});
|
|
},
|
|
child: AnimatedContainer(
|
|
duration: const Duration(milliseconds: 400),
|
|
curve: Curves.easeOutCubic,
|
|
width: resolvedSize,
|
|
height: resolvedSize,
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(16),
|
|
child: QrImage(
|
|
embeddedImagePath: widget.sendViewModel.currency.iconPath,
|
|
data: uri.toString(),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
AddressFormatter.buildSegmentedAddress(
|
|
address: output.address,
|
|
evenTextStyle: TextStyle(color: Theme.of(context).colorScheme.onSurface,fontFamily: "IBM Plex Mono"),
|
|
textAlign: TextAlign.center),
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
color: warningBackgroundColor,
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
child: Padding(
|
|
padding: EdgeInsets.all(20),
|
|
child: Text(
|
|
S.of(context).lightning_external_disclaimer,
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
color: warningTextColor,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w500),
|
|
),
|
|
)),
|
|
Row(
|
|
spacing: 8,
|
|
children: [
|
|
Flexible(
|
|
child: NewPrimaryButton(
|
|
onPressed:(){
|
|
Clipboard.setData(
|
|
ClipboardData(text: output.address),
|
|
);
|
|
},
|
|
text: S.of(context).copy,
|
|
color: Theme.of(context).colorScheme.primary,
|
|
textColor: Theme.of(context).colorScheme.onPrimary),
|
|
),
|
|
Flexible(
|
|
child: NewPrimaryButton(
|
|
onPressed: Navigator.of(context).pop,
|
|
text: S.of(context).sent_the_funds,
|
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
textColor: Theme.of(context).colorScheme.primary),
|
|
),
|
|
],
|
|
),
|
|
SizedBox()
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|