restrict spark memo length in textfield

This commit is contained in:
julian 2024-01-12 16:00:04 -06:00
parent 05c2974eb0
commit d7a7b7758d
2 changed files with 8 additions and 0 deletions

View file

@ -1397,6 +1397,10 @@ class _SendViewState extends ConsumerState<SendView> {
), ),
child: TextField( child: TextField(
key: const Key("sendViewMemoFieldKey"), key: const Key("sendViewMemoFieldKey"),
maxLength: (coin == Coin.firo ||
coin == Coin.firoTestNet)
? 31
: null,
controller: memoController, controller: memoController,
readOnly: false, readOnly: false,
autocorrect: false, autocorrect: false,
@ -1411,6 +1415,7 @@ class _SendViewState extends ConsumerState<SendView> {
_memoFocus, _memoFocus,
context, context,
).copyWith( ).copyWith(
counterText: '',
contentPadding: const EdgeInsets.only( contentPadding: const EdgeInsets.only(
left: 16, left: 16,
top: 6, top: 6,

View file

@ -1503,6 +1503,8 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
Constants.size.circularBorderRadius, Constants.size.circularBorderRadius,
), ),
child: TextField( child: TextField(
maxLength:
(coin == Coin.firo || coin == Coin.firoTestNet) ? 31 : null,
minLines: 1, minLines: 1,
maxLines: 5, maxLines: 5,
key: const Key("sendViewMemoFieldKey"), key: const Key("sendViewMemoFieldKey"),
@ -1526,6 +1528,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
context, context,
desktopMed: true, desktopMed: true,
).copyWith( ).copyWith(
counterText: '',
contentPadding: const EdgeInsets.only( contentPadding: const EdgeInsets.only(
left: 16, left: 16,
top: 11, top: 11,