change send button text when disabled
OmarHatem committed
Aug 4, 2025 at 03:13 UTC
155b9ab32c9917ce3cac895818753ca16b5d7d69
1 file changed
+12
-3
lib/src/screens/send/send_page.dart
+12
-3
@@ -470,9 +470,7 @@ class SendPage extends BasePage {
470
},
471
);
472
},
473
- text: sendViewModel.payjoinUri != null
474
- ? S.of(context).send_payjoin
475
- : S.of(context).send,
473
+ text: _sendButtonText(context),
474
color: Theme.of(context).colorScheme.primary,
475
textColor: Theme.of(context).colorScheme.onPrimary,
476
isLoading: sendViewModel.state is IsExecutingState ||
@@ -841,4 +839,15 @@ class SendPage extends BasePage {
839
840
return isValid;
841
}
842
+
843
+ String _sendButtonText(BuildContext context) {
844
+ if (!sendViewModel.isReadyForSend) {
845
+ return S.of(context).synchronizing;
846
+ }
847
+ if (sendViewModel.payjoinUri != null) {
848
+ return S.of(context).send_payjoin;
849
+ } else {
850
+ return S.of(context).send;
851
+ }
852
+ }
853
}