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.
144 lines
6.1 KiB
Dart
144 lines
6.1 KiB
Dart
import 'package:hash_wallet/new-ui/widgets/send_page/floating_icon_button.dart';
|
|
import 'package:hash_wallet/src/widgets/hash_image_widget.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_mobx/flutter_mobx.dart';
|
|
|
|
class NewSendAmountInput extends StatefulWidget {
|
|
const NewSendAmountInput(
|
|
{super.key,
|
|
required this.currency,
|
|
required this.hasPicker,
|
|
required this.onPickerClicked,
|
|
required this.currencyIconPath,
|
|
required this.amountController,
|
|
this.validator});
|
|
|
|
final String currency;
|
|
final String currencyIconPath;
|
|
final bool hasPicker;
|
|
final VoidCallback onPickerClicked;
|
|
final TextEditingController amountController;
|
|
final FormFieldValidator<String>? validator;
|
|
|
|
@override
|
|
State<NewSendAmountInput> createState() => _NewSendAmountInputState();
|
|
}
|
|
|
|
class _NewSendAmountInputState extends State<NewSendAmountInput> {
|
|
final formFieldKey = GlobalKey<FormFieldState<String>>();
|
|
|
|
@override
|
|
void initState() {
|
|
widget.amountController.addListener(()=>formFieldKey.currentState?.didChange(widget.amountController.text));
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return FormField<String>(
|
|
key: formFieldKey,
|
|
initialValue: widget.amountController.text,
|
|
validator: widget.validator,
|
|
builder: (state) => Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
color: widget.hasPicker
|
|
? Theme.of(context).colorScheme.surfaceContainerHigh
|
|
: Theme.of(context).colorScheme.surfaceContainer,
|
|
borderRadius: BorderRadius.circular(18)),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
borderRadius: BorderRadius.horizontal(left: Radius.circular(18))),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
spacing: 8,
|
|
children: [
|
|
Expanded(
|
|
child: TextField(
|
|
keyboardType:
|
|
TextInputType.numberWithOptions(signed: false, decimal: true),
|
|
inputFormatters: <TextInputFormatter>[
|
|
FilteringTextInputFormatter.allow(RegExp(r'^\d*[.,]?\d*$'))
|
|
],
|
|
onChanged: state.didChange,
|
|
controller: widget.amountController,
|
|
decoration: InputDecoration(hintText: "0", errorMaxLines: 3),
|
|
),
|
|
),
|
|
FloatingIconButton(
|
|
iconPath: "assets/new-ui/paste.svg",
|
|
onPressed: () async {
|
|
final data = await Clipboard.getData(Clipboard.kTextPlain);
|
|
if (data != null && data.text != null) {
|
|
widget.amountController.text = data.text!;
|
|
}
|
|
}),
|
|
SizedBox.shrink()
|
|
],
|
|
),
|
|
),
|
|
),
|
|
IntrinsicWidth(
|
|
child: Observer(
|
|
builder: (_) {
|
|
return GestureDetector(
|
|
onTap: widget.onPickerClicked,
|
|
child: Container(
|
|
alignment: Alignment.center,
|
|
width: double.infinity,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.only(
|
|
topRight: Radius.circular(18),
|
|
bottomRight: Radius.circular(18)),
|
|
color: widget.hasPicker
|
|
? Theme.of(context).colorScheme.surfaceContainerHigh
|
|
: Theme.of(context).colorScheme.surfaceContainer,
|
|
),
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.max,
|
|
spacing: 8,
|
|
children: [
|
|
if (widget.hasPicker && widget.currencyIconPath.isNotEmpty)
|
|
HashImageWidget(imageUrl: widget.currencyIconPath, width: 24, height: 24),
|
|
Text(widget.currency),
|
|
if (widget.hasPicker)
|
|
HashImageWidget(imageUrl:
|
|
"assets/new-ui/chooser.svg",
|
|
width: 12,
|
|
height: 12,
|
|
colorFilter: ColorFilter.mode(
|
|
Theme.of(context).colorScheme.primary,
|
|
BlendMode.srcIn),
|
|
)
|
|
],
|
|
))),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
)),
|
|
if (state.hasError)
|
|
Padding(
|
|
padding: EdgeInsets.only(top: 6, left: 8),
|
|
child: Text(
|
|
state.errorText!,
|
|
style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.error),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|