Files
hash-wallet/lib/new-ui/widgets/send_page/send_memo_input.dart
T
1d652c76aa feat: Add memo support for swap (#3229)
* feat: Add memo support for swap

* fix: Error on swap page select receiver bottomsheet when picking receiveing currency that's not a wallet type

* feat: exclude providers that do not support memo when receive currency needs it, also show passed memo in confirmation and trade history sheets

* fix: overflow for destination tag on swap confirmation

* Update lib/view_model/exchange/exchange_view_model.dart [skip ci]

* Update lib/exchange/provider/trocador_exchange_provider.dart [skip ci]

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2026-05-20 20:09:34 +02:00

74 lines
2.4 KiB
Dart

import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/new-ui/widgets/send_page/floating_icon_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class NewSendMemoInput extends StatelessWidget {
const NewSendMemoInput(
{super.key,
required this.memoController,
required this.maxMemoLength,
required this.memoLength,
this.hintText,
this.disclaimerText});
final TextEditingController memoController;
final int maxMemoLength;
final int memoLength;
final String? hintText;
final String? disclaimerText;
@override
Widget build(BuildContext context) {
return Column(
spacing: 8,
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).colorScheme.surfaceContainer,
),
child: Row(
children: [
Expanded(
child: TextField(
maxLength: maxMemoLength,
controller: memoController,
decoration: InputDecoration(
hintText: hintText ?? S.of(context).memo_optional, counterText: ""),
),
),
SizedBox(width: 12),
FloatingIconButton(
iconPath: "assets/new-ui/paste.svg",
onPressed: () async {
final data = await Clipboard.getData(Clipboard.kTextPlain);
if (data != null && data.text != null) {
memoController.text = data.text!;
}
}),
SizedBox(width: 12)
],
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(disclaimerText ?? S.of(context).memo_disclaimer,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.onSurfaceVariant)),
),
Text("${memoController.text.length} / ${maxMemoLength}",
style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.primary))
],
),
)
],
);
}
}