In send screen, allow address input to be expanded and add paste from clipboard icon
What changed, and why it matters
This commit is mostly a user-interface convenience update for a cryptocurrency wallet app. It adds a 'paste from clipboard' button on the send screen, lets the address box expand to multiple lines, removes a couple of unnecessary 'const' keywords, and waits for the Tor privacy network to finish connecting before continuing setup. The changes do not appear to fix a security vulnerability, but the Tor wait could prevent a rare race condition where the app tries to use Tor before it is ready.
No security action required. Treat as a routine UI/UX improvement. If desired, verify that clipboard paste does not bypass existing address validation and that the Tor wait handles timeout/failure gracefully.
Security signals we found
Clipboard paste helper introduced for address input (UX convenience, not a vulnerability)
Tor startup now waits for connection before proceeding, reducing race-condition risk
No input validation, sanitization, or cryptographic changes observed
Evidence from the diff
The diff modifies three Flutter/Dart screens. In connection_setup.dart, it adds await TorService.sharedInstance.waitUntilConnected() after starting Tor, ensuring the proxy is ready before reading its port. In restore_wallet.dart, two const EdgeInsets constructors are changed to non-const EdgeInsets, a benign style/refactor change. In send.dart, the destination address TextField is made multi-line (maxLines: null), a _pasteAddressFromClipboard() helper reads Clipboard.kTextPlain and writes it into the address controller, and the suffix icon is replaced by a Row containing both paste and QR-scan IconButtons. No cryptographic, validation, or network security logic is changed.
Changed components
lib/screens/send.dartlib/screens/connection_setup.dartlib/screens/restore_wallet.dartInspect captured patch +26 / −5
diff --git a/lib/screens/connection_setup.dart b/lib/screens/connection_setup.dart
index 29d385c..06545b3 100644
--- a/lib/screens/connection_setup.dart
+++ b/lib/screens/connection_setup.dart
@@ -68,6 +68,7 @@ class _ConnectionSetupScreenState extends State<ConnectionSetupScreen> {
if (_useTor) {
await TorService.sharedInstance.start();
+ await TorService.sharedInstance.waitUntilConnected();
torProxyPort = TorService.sharedInstance.getProxyInfo().port.toString();
}
diff --git a/lib/screens/restore_wallet.dart b/lib/screens/restore_wallet.dart
index f602337..dc50893 100644
--- a/lib/screens/restore_wallet.dart
+++ b/lib/screens/restore_wallet.dart
@@ -83,7 +83,7 @@ class _RestoreWalletScreenState extends State<RestoreWalletScreen> {
style: Theme.of(context).textTheme.headlineMedium,
),
Padding(
- padding: const EdgeInsets.symmetric(horizontal: 40),
+ padding: EdgeInsets.symmetric(horizontal: 40),
child: Text(
i18n.restoreWalletDescription,
textAlign: TextAlign.center,
@@ -105,7 +105,7 @@ class _RestoreWalletScreenState extends State<RestoreWalletScreen> {
),
),
Padding(
- padding: const EdgeInsets.symmetric(horizontal: 20),
+ padding: EdgeInsets.symmetric(horizontal: 20),
child: TextFormField(
controller: _restoreHeightController,
keyboardType: TextInputType.number,
diff --git a/lib/screens/send.dart b/lib/screens/send.dart
index 134c46b..a9b5325 100644
--- a/lib/screens/send.dart
+++ b/lib/screens/send.dart
@@ -55,6 +55,14 @@ class _SendScreenState extends State<SendScreen> {
}
}
+ void _pasteAddressFromClipboard() async {
+ ClipboardData? data = await Clipboard.getData(Clipboard.kTextPlain);
+
+ if (data != null) {
+ _destinationAddressController.text = data.text ?? '';
+ }
+ }
+
Future<void> _send() async {
final amount = double.parse(_amountController.text);
@@ -197,15 +205,27 @@ class _SendScreenState extends State<SendScreen> {
),
TextField(
controller: _destinationAddressController,
+ maxLines: null,
decoration: InputDecoration(
labelText: i18n.address,
border: OutlineInputBorder(),
errorText: _destinationAddressError != ''
? _destinationAddressError
: null,
- suffixIcon: IconButton(
- onPressed: () => Navigator.pushNamed(context, '/scan_qr'),
- icon: Icon(Icons.qr_code),
+ suffixIcon: Row(
+ spacing: 0,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ IconButton(
+ onPressed: _pasteAddressFromClipboard,
+ icon: Icon(Icons.paste),
+ ),
+ IconButton(
+ onPressed: () =>
+ Navigator.pushNamed(context, '/scan_qr'),
+ icon: Icon(Icons.qr_code),
+ ),
+ ],
),
),
),
Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.