refactor(connector): adjust frame length check and simplify contact handling logic

refactor(settings): extract settings sending logic into a separate method
refactor(ble_debug_log_service): remove unused command case for radio settings
refactor(app_bar): update compact width threshold for app bar display
This commit is contained in:
Winston Lowe
2026-03-01 13:05:57 -08:00
parent d2640e1294
commit fcab69f9f0
4 changed files with 30 additions and 24 deletions
+27 -9
View File
@@ -938,16 +938,15 @@ class _SettingsScreenState extends State<SettingsScreen> {
child: Text(l10n.common_cancel),
),
TextButton(
onPressed: () async {
final frame = buildSetAutoAddConfigFrame(
autoAddChat: autoAddChat,
autoAddRepeater: autoAddRepeater,
autoAddRoomServer: autoAddRoomServer,
autoAddSensor: autoAddSensor,
overwriteOldest: overwriteOldest,
onPressed: () {
_sendSettings(
connector,
autoAddChat,
autoAddRepeater,
autoAddRoomServer,
autoAddSensor,
overwriteOldest,
);
await connector.sendFrame(frame);
await connector.sendFrame(buildGetAutoAddFlagsFrame());
Navigator.pop(context);
},
child: Text(l10n.common_save),
@@ -957,6 +956,25 @@ class _SettingsScreenState extends State<SettingsScreen> {
),
);
}
void _sendSettings(
MeshCoreConnector connector,
autoAddChat,
autoAddRepeater,
autoAddRoomServer,
autoAddSensor,
overwriteOldest,
) async {
final frame = buildSetAutoAddConfigFrame(
autoAddChat: autoAddChat,
autoAddRepeater: autoAddRepeater,
autoAddRoomServer: autoAddRoomServer,
autoAddSensor: autoAddSensor,
overwriteOldest: overwriteOldest,
);
await connector.sendFrame(frame);
await connector.sendFrame(buildGetAutoAddFlagsFrame());
}
}
class _RadioSettingsDialog extends StatefulWidget {