Refactor code structure and remove redundant sections for improved readability and maintainability

This commit is contained in:
zjs81
2026-06-12 22:55:41 -07:00
parent 51d6210920
commit 3707acb124
34 changed files with 1008 additions and 84 deletions
+18 -10
View File
@@ -725,18 +725,26 @@ class _SettingsScreenState extends State<SettingsScreen> {
onPressed: () => Navigator.pop(context),
child: Text(l10n.common_cancel),
),
TextButton(
onPressed: () async {
Navigator.pop(context);
await connector.setNodeName(controller.text);
await connector.refreshDeviceInfo();
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(l10n.settings_nodeNameUpdated),
ListenableBuilder(
listenable: controller,
builder: (context, _) {
final name = controller.text.trim();
return TextButton(
onPressed: name.isEmpty
? null
: () async {
Navigator.pop(context);
await connector.setNodeName(name);
await connector.refreshDeviceInfo();
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(l10n.settings_nodeNameUpdated),
);
},
child: Text(l10n.common_save),
);
},
child: Text(l10n.common_save),
),
],
),