Fix some screens too wide on desktop
What changed, and why it matters
This commit is a routine user-interface layout fix. It limits how wide three wallet setup screens can stretch on desktop computers by wrapping them in a centered container with a maximum width. There is no security-relevant change.
No security action needed; treat as a normal UI/UX improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff wraps the Scaffold body content of connection_setup.dart, generate_seed.dart, and restore_wallet.dart in a Container with BoxConstraints(maxWidth: 500/540) and a Center widget. It also reformats long lines and adds runSpacing: 10 to a Wrap widget. No logic, validation, cryptography, network handling, or authentication behavior is changed.
Changed components
lib/screens/connection_setup.dartlib/screens/generate_seed.dartlib/screens/restore_wallet.dartInspect captured patch +203 / −234
diff --git a/lib/screens/connection_setup.dart b/lib/screens/connection_setup.dart
index d61e1cd..1308c10 100644
--- a/lib/screens/connection_setup.dart
+++ b/lib/screens/connection_setup.dart
@@ -19,8 +19,7 @@ class ConnectionSetupScreen extends StatefulWidget {
class _ConnectionSetupScreenState extends State<ConnectionSetupScreen> {
final TextEditingController _addressController = TextEditingController();
- final TextEditingController _customProxyPortController =
- TextEditingController();
+ final TextEditingController _customProxyPortController = TextEditingController();
bool _useTor = false;
bool _useSsl = false;
@@ -64,9 +63,7 @@ class _ConnectionSetupScreenState extends State<ConnectionSetupScreen> {
final ipAddressRegex = RegExp(
r'^(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}$',
);
- final onionAddressRegex = RegExp(
- r'^[a-z2-7]{56}|[a-z2-7]{16}.onion(:\d{1,5})?$',
- );
+ final onionAddressRegex = RegExp(r'^[a-z2-7]{56}|[a-z2-7]{16}.onion(:\d{1,5})?$');
final domainAddressRegex = RegExp(
r'^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,63}(?::\d{1,5})?$',
);
@@ -154,8 +151,7 @@ class _ConnectionSetupScreenState extends State<ConnectionSetupScreen> {
).timeout(Duration(seconds: 10));
setState(() {
- _connectionSuccess =
- response.statusCode == HttpStatus.internalServerError;
+ _connectionSuccess = response.statusCode == HttpStatus.internalServerError;
});
} else {
var httpClient = HttpClient();
@@ -171,8 +167,7 @@ class _ConnectionSetupScreenState extends State<ConnectionSetupScreen> {
final response = await request.close().timeout(Duration(seconds: 10));
setState(() {
- _connectionSuccess =
- response.statusCode == HttpStatus.internalServerError;
+ _connectionSuccess = response.statusCode == HttpStatus.internalServerError;
});
}
} catch (error) {
@@ -221,124 +216,109 @@ class _ConnectionSetupScreenState extends State<ConnectionSetupScreen> {
return Scaffold(
body: Center(
- child: Padding(
- padding: EdgeInsets.all(20),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- spacing: 20,
- children: [
- Column(
- spacing: 10,
- children: [
- Text(
- i18n.connectionSetupTitle,
- style: Theme.of(context).textTheme.headlineMedium,
- ),
- Text(
- i18n.connectionSetupDescription,
- textAlign: TextAlign.center,
- style: Theme.of(context).textTheme.bodyLarge,
- ),
- ],
- ),
- Column(
- spacing: 10,
- children: [
- TextFormField(
- controller: _addressController,
- onChanged: onAddressChange,
- decoration: InputDecoration(
- labelText: i18n.address,
- hintText: i18n.connectionSetupAddressHint,
- border: OutlineInputBorder(
- borderRadius: BorderRadius.circular(8.0),
- ),
- suffixIcon: _hasTested && !_connectionTestIsLoading
- ? Icon(
- _connectionSuccess
- ? Icons.check
- : Icons.cancel_outlined,
- )
- : null,
- suffixIconColor: _connectionSuccess
- ? Colors.teal
- : Colors.red,
+ child: Container(
+ constraints: BoxConstraints(maxWidth: 500),
+ child: Padding(
+ padding: EdgeInsets.all(20),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ spacing: 20,
+ children: [
+ Column(
+ spacing: 10,
+ children: [
+ Text(
+ i18n.connectionSetupTitle,
+ style: Theme.of(context).textTheme.headlineMedium,
+ ),
+ Text(
+ i18n.connectionSetupDescription,
+ textAlign: TextAlign.center,
+ style: Theme.of(context).textTheme.bodyLarge,
),
- keyboardType: TextInputType.url,
- ),
- TextFormField(
- controller: _customProxyPortController,
- onChanged: onProxyPortChange,
- enabled: !_useTor,
- decoration: InputDecoration(
- labelText: i18n.connectionSetupProxyPortLabel,
- hintText: i18n.connectionSetupProxyPortHint,
- border: OutlineInputBorder(
- borderRadius: BorderRadius.circular(8.0),
+ ],
+ ),
+ Column(
+ spacing: 10,
+ children: [
+ TextFormField(
+ controller: _addressController,
+ onChanged: onAddressChange,
+ decoration: InputDecoration(
+ labelText: i18n.address,
+ hintText: i18n.connectionSetupAddressHint,
+ border: OutlineInputBorder(borderRadius: BorderRadius.circular(8.0)),
+ suffixIcon: _hasTested && !_connectionTestIsLoading
+ ? Icon(_connectionSuccess ? Icons.check : Icons.cancel_outlined)
+ : null,
+ suffixIconColor: _connectionSuccess ? Colors.teal : Colors.red,
),
+ keyboardType: TextInputType.url,
),
- keyboardType: TextInputType.number,
- inputFormatters: <TextInputFormatter>[
- FilteringTextInputFormatter.digitsOnly,
- ],
- ),
- CheckboxListTile(
- title: Text(i18n.connectionSetupUseTorLabel),
- value: _useTor,
- onChanged: !_useSsl ? setUseTor : null,
- controlAffinity: ListTileControlAffinity.leading,
- contentPadding: EdgeInsets.zero,
- ),
- CheckboxListTile(
- title: Text(i18n.connectionSetupUseSslLabel),
- value: _useSsl,
- onChanged: !_useTor ? setUseSsl : null,
- controlAffinity: ListTileControlAffinity.leading,
- contentPadding: EdgeInsets.zero,
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- spacing: 10,
- children: [
- TextButton.icon(
- label: Text(i18n.connectionSetupTestConnectionButton),
- onPressed: () => _testConnection(),
- icon: !_connectionTestIsLoading
- ? Icon(Icons.network_check)
- : SizedBox(
- width: 16,
- height: 16,
- child: CircularProgressIndicator(
- strokeWidth: 2,
- ),
- ),
+ TextFormField(
+ controller: _customProxyPortController,
+ onChanged: onProxyPortChange,
+ enabled: !_useTor,
+ decoration: InputDecoration(
+ labelText: i18n.connectionSetupProxyPortLabel,
+ hintText: i18n.connectionSetupProxyPortHint,
+ border: OutlineInputBorder(borderRadius: BorderRadius.circular(8.0)),
),
- if (_connectionSuccess &&
- _hasTested &&
- !_connectionTestIsLoading)
- FilledButton.icon(
- onPressed: _saveConnection,
- icon: !_connectionSaveIsLoading
- ? Icon(Icons.arrow_outward_rounded)
+ keyboardType: TextInputType.number,
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
+ ),
+ CheckboxListTile(
+ title: Text(i18n.connectionSetupUseTorLabel),
+ value: _useTor,
+ onChanged: !_useSsl ? setUseTor : null,
+ controlAffinity: ListTileControlAffinity.leading,
+ contentPadding: EdgeInsets.zero,
+ ),
+ CheckboxListTile(
+ title: Text(i18n.connectionSetupUseSslLabel),
+ value: _useSsl,
+ onChanged: !_useTor ? setUseSsl : null,
+ controlAffinity: ListTileControlAffinity.leading,
+ contentPadding: EdgeInsets.zero,
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ spacing: 10,
+ children: [
+ TextButton.icon(
+ label: Text(i18n.connectionSetupTestConnectionButton),
+ onPressed: () => _testConnection(),
+ icon: !_connectionTestIsLoading
+ ? Icon(Icons.network_check)
: SizedBox(
width: 16,
height: 16,
- child: CircularProgressIndicator(
- strokeWidth: 2,
- color: isDarkTheme
- ? Theme.of(
- context,
- ).colorScheme.onPrimary
- : Colors.white,
- ),
+ child: CircularProgressIndicator(strokeWidth: 2),
),
- label: Text(i18n.connectionSetupContinueButton),
),
- ],
- ),
- ],
- ),
- ],
+ if (_connectionSuccess && _hasTested && !_connectionTestIsLoading)
+ FilledButton.icon(
+ onPressed: _saveConnection,
+ icon: !_connectionSaveIsLoading
+ ? Icon(Icons.arrow_outward_rounded)
+ : SizedBox(
+ width: 16,
+ height: 16,
+ child: CircularProgressIndicator(
+ strokeWidth: 2,
+ color: isDarkTheme
+ ? Theme.of(context).colorScheme.onPrimary
+ : Colors.white,
+ ),
+ ),
+ label: Text(i18n.connectionSetupContinueButton),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ],
+ ),
),
),
),
diff --git a/lib/screens/generate_seed.dart b/lib/screens/generate_seed.dart
index 00b8ef7..2ab1888 100644
--- a/lib/screens/generate_seed.dart
+++ b/lib/screens/generate_seed.dart
@@ -87,45 +87,47 @@ class _GenerateSeedScreenState extends State<GenerateSeedScreen> {
return Scaffold(
body: SafeArea(
- child: Padding(
- padding: EdgeInsetsGeometry.all(20),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- spacing: 20,
- children: [
- Text(
- i18n.generateSeedTitle,
- style: Theme.of(context).textTheme.headlineMedium,
- ),
- Padding(
- padding: EdgeInsets.symmetric(horizontal: 20),
- child: Text(
- i18n.generateSeedDescription,
- textAlign: TextAlign.center,
- style: Theme.of(context).textTheme.bodyLarge,
- ),
- ),
- if (_seed.isEmpty || _restoreHeight == 0)
- CircularProgressIndicator(),
- if (_seed.isNotEmpty && _restoreHeight > 0)
- Wrap(
- alignment: WrapAlignment.center,
- spacing: 10,
- children: _seed.map((word) {
- return Chip(label: Text(word));
- }).toList(),
- ),
- if (_seed.isNotEmpty && _restoreHeight > 0)
- FilledButton(
- onPressed: () => Navigator.pushNamedAndRemoveUntil(
- context,
- '/lws_details',
- (Route<dynamic> route) => false,
- arguments: _restoreHeight,
+ child: Center(
+ child: Container(
+ constraints: BoxConstraints(maxWidth: 540),
+ child: Padding(
+ padding: EdgeInsetsGeometry.all(20),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ spacing: 20,
+ children: [
+ Text(i18n.generateSeedTitle, style: Theme.of(context).textTheme.headlineMedium),
+ Padding(
+ padding: EdgeInsets.symmetric(horizontal: 20),
+ child: Text(
+ i18n.generateSeedDescription,
+ textAlign: TextAlign.center,
+ style: Theme.of(context).textTheme.bodyLarge,
+ ),
),
- child: Text(i18n.generateSeedContinueButton),
- ),
- ],
+ if (_seed.isEmpty || _restoreHeight == 0) CircularProgressIndicator(),
+ if (_seed.isNotEmpty && _restoreHeight > 0)
+ Wrap(
+ alignment: WrapAlignment.center,
+ spacing: 10,
+ runSpacing: 10,
+ children: _seed.map((word) {
+ return Chip(label: Text(word));
+ }).toList(),
+ ),
+ if (_seed.isNotEmpty && _restoreHeight > 0)
+ FilledButton(
+ onPressed: () => Navigator.pushNamedAndRemoveUntil(
+ context,
+ '/lws_details',
+ (Route<dynamic> route) => false,
+ arguments: _restoreHeight,
+ ),
+ child: Text(i18n.generateSeedContinueButton),
+ ),
+ ],
+ ),
+ ),
),
),
),
diff --git a/lib/screens/restore_wallet.dart b/lib/screens/restore_wallet.dart
index 3591874..0bb591c 100644
--- a/lib/screens/restore_wallet.dart
+++ b/lib/screens/restore_wallet.dart
@@ -75,9 +75,7 @@ class _RestoreWalletScreenState extends State<RestoreWalletScreen> {
}
if (mounted) {
- ScaffoldMessenger.of(
- context,
- ).showSnackBar(SnackBar(content: Text(errorMsg)));
+ ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(errorMsg)));
}
return;
} catch (error) {
@@ -88,9 +86,7 @@ class _RestoreWalletScreenState extends State<RestoreWalletScreen> {
if (mounted) {
final i18n = AppLocalizations.of(context)!;
- ScaffoldMessenger.of(
- context,
- ).showSnackBar(SnackBar(content: Text(i18n.unknownError)));
+ ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(i18n.unknownError)));
}
return;
}
@@ -102,11 +98,7 @@ class _RestoreWalletScreenState extends State<RestoreWalletScreen> {
wallet.load();
if (mounted) {
- Navigator.pushNamedAndRemoveUntil(
- context,
- '/wallet_home',
- (Route<dynamic> route) => false,
- );
+ Navigator.pushNamedAndRemoveUntil(context, '/wallet_home', (Route<dynamic> route) => false);
}
}
@@ -118,78 +110,73 @@ class _RestoreWalletScreenState extends State<RestoreWalletScreen> {
return Scaffold(
appBar: AppBar(title: Text('Skylight Monero Wallet')),
body: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- spacing: 20,
- children: [
- Text(
- i18n.restoreWalletTitle,
- style: Theme.of(context).textTheme.headlineMedium,
- ),
- Padding(
- padding: EdgeInsets.symmetric(horizontal: 40),
- child: Text(
- i18n.restoreWalletDescription,
- textAlign: TextAlign.center,
- style: Theme.of(context).textTheme.bodyLarge,
- ),
- ),
- Padding(
- padding: EdgeInsets.symmetric(horizontal: 20),
- child: TextFormField(
- controller: _mnemonicController,
- keyboardType: TextInputType.multiline,
- maxLines: null,
- minLines: 3,
- decoration: InputDecoration(
- labelText: i18n.restoreWalletSeedLabel,
- errorText: _mnemonicError,
- border: OutlineInputBorder(),
+ child: Container(
+ constraints: BoxConstraints(maxWidth: 500),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ spacing: 20,
+ children: [
+ Text(i18n.restoreWalletTitle, style: Theme.of(context).textTheme.headlineMedium),
+ Padding(
+ padding: EdgeInsets.symmetric(horizontal: 40),
+ child: Text(
+ i18n.restoreWalletDescription,
+ textAlign: TextAlign.center,
+ style: Theme.of(context).textTheme.bodyLarge,
),
),
- ),
- Padding(
- padding: EdgeInsets.symmetric(horizontal: 20),
- child: TextFormField(
- controller: _restoreHeightController,
- keyboardType: TextInputType.number,
- inputFormatters: <TextInputFormatter>[
- FilteringTextInputFormatter.digitsOnly,
- ],
- decoration: InputDecoration(
- labelText: i18n.restoreWalletRestoreHeightLabel,
- errorText: _restoreHeightError,
- border: OutlineInputBorder(),
+ Padding(
+ padding: EdgeInsets.symmetric(horizontal: 20),
+ child: TextFormField(
+ controller: _mnemonicController,
+ keyboardType: TextInputType.multiline,
+ maxLines: null,
+ minLines: 3,
+ decoration: InputDecoration(
+ labelText: i18n.restoreWalletSeedLabel,
+ errorText: _mnemonicError,
+ border: OutlineInputBorder(),
+ ),
),
),
- ),
- Row(
- spacing: 20,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- TextButton(
- onPressed: () => Navigator.pop(context),
- child: Text(i18n.cancel),
- ),
- FilledButton.icon(
- onPressed: _restore,
- label: Text(i18n.restoreWalletRestoreButton),
- icon: _isLoading
- ? SizedBox(
- width: 16,
- height: 16,
- child: CircularProgressIndicator(
- strokeWidth: 2,
- color: isDarkTheme
- ? Theme.of(context).colorScheme.onPrimary
- : Colors.white,
- ),
- )
- : null,
+ Padding(
+ padding: EdgeInsets.symmetric(horizontal: 20),
+ child: TextFormField(
+ controller: _restoreHeightController,
+ keyboardType: TextInputType.number,
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
+ decoration: InputDecoration(
+ labelText: i18n.restoreWalletRestoreHeightLabel,
+ errorText: _restoreHeightError,
+ border: OutlineInputBorder(),
+ ),
),
- ],
- ),
- ],
+ ),
+ Row(
+ spacing: 20,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ TextButton(onPressed: () => Navigator.pop(context), child: Text(i18n.cancel)),
+ FilledButton.icon(
+ onPressed: _restore,
+ label: Text(i18n.restoreWalletRestoreButton),
+ icon: _isLoading
+ ? SizedBox(
+ width: 16,
+ height: 16,
+ child: CircularProgressIndicator(
+ strokeWidth: 2,
+ color: isDarkTheme
+ ? Theme.of(context).colorScheme.onPrimary
+ : Colors.white,
+ ),
+ )
+ : null,
+ ),
+ ],
+ ),
+ ],
+ ),
),
),
);
Why this scored 15/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.