@@ -19,6 +19,8 @@ import '../../../widgets/detail_item.dart';
1919import '../../../widgets/dialogs/s_dialog.dart' ;
2020import '../../../widgets/rounded_container.dart' ;
2121import '../../../widgets/textfields/adaptive_text_field.dart' ;
22+ import '../../wallet_view/transaction_views/transaction_details_view.dart'
23+ show IconCopyButton;
2224import '../signing_view.dart' ;
2325import 'address_list.dart' ;
2426
@@ -32,7 +34,7 @@ final class _SignState {
3234 required this .signature,
3335 });
3436
35- bool get isValid => message.isNotEmpty && address != null ;
37+ bool get isValid => message.trim (). isNotEmpty && address != null ;
3638
3739 _SignState copyWith ({String ? message, String ? signature}) {
3840 return _SignState (
@@ -77,9 +79,9 @@ class _SignMessageFormState extends ConsumerState<SignMessageForm> {
7779 TextStyle _getStyle (BuildContext context) {
7880 return Util .isDesktop
7981 ? STextStyles .desktopTextExtraExtraSmall (context).copyWith (
80- color: Theme .of (
81- context,
82- ). extension < StackColors > () ! .textFieldActiveSearchIconRight,
82+ color: Theme .of (context)
83+ . extension < StackColors > () !
84+ .textFieldActiveSearchIconRight,
8385 )
8486 : STextStyles .smallMed12 (context);
8587 }
@@ -133,9 +135,9 @@ class _SignMessageFormState extends ConsumerState<SignMessageForm> {
133135 child: RoundedContainer (
134136 padding: EdgeInsets .zero,
135137 color: Colors .transparent,
136- borderColor: Theme .of (
137- context,
138- ). extension < StackColors > () ! .textFieldDefaultBG,
138+ borderColor: Theme .of (context)
139+ . extension < StackColors > () !
140+ .textFieldDefaultBG,
139141 child: child,
140142 ),
141143 ),
@@ -181,9 +183,11 @@ class _SignMessageFormState extends ConsumerState<SignMessageForm> {
181183 onException: (e) => ex = e,
182184 );
183185
184- if (mounted && ex != null ) {
186+ if (! mounted || ! identical (ref.read (_pSignState), state)) return ;
187+
188+ if (ex != null ) {
185189 await showSignVerifyError (ex! , context: context);
186- } else if (signature != null && mounted ) {
190+ } else if (signature != null ) {
187191 ref.read (_pSignState.notifier).state = state.copyWith (
188192 signature: signature,
189193 );
@@ -214,7 +218,13 @@ class _SignMessageFormState extends ConsumerState<SignMessageForm> {
214218 AdaptiveTextField (
215219 controller: messageController,
216220 showPasteClearButton: true ,
217- maxLines: 1 ,
221+ trimPastedText: false ,
222+ autocorrect: false ,
223+ smartDashesType: SmartDashesType .disabled,
224+ smartQuotesType: SmartQuotesType .disabled,
225+ enableSuggestions: false ,
226+ minLines: 1 ,
227+ maxLines: 5 ,
218228 onChangedComprehensive: (_) {
219229 if (mounted) {
220230 ref.read (_pSignState.notifier).state = ref
@@ -249,6 +259,8 @@ class _SignMessageFormState extends ConsumerState<SignMessageForm> {
249259 noPadding: Util .isDesktop,
250260 button: ref.watch (_pSignState.select ((s) => s.signature)).isEmpty
251261 ? null
262+ : Util .isDesktop
263+ ? IconCopyButton (data: ref.read (_pSignState).signature)
252264 : SimpleCopyButton (data: ref.read (_pSignState).signature),
253265 ),
254266
0 commit comments