Connect a radio: one page with Bluetooth, USB and TCP tabs

Replace the scanner, USB and TCP screens with one page and a tab for
each, so the design and the connection options are consistent. Fixes
#699, where the USB screen's Bluetooth button went back to the main
screens instead of the scanner.

The "Need a new node?" banner shows on every tab, with a close button
that hides it until the page is opened again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
celsoazevedoandClaude Opus 5.5 committed 2026-11-26 08:57:32 +00:00
1 parent 86b3e252c6
commit 9104b4a60a
60 files changed
+989 -1474

No files matched your search

+8 -7
View File
@@ -4,9 +4,8 @@ import 'package:provider/provider.dart';
import '../connector/meshcore_connector.dart';
import '../helpers/snack_bar_builder.dart';
import '../l10n/l10n.dart';
import '../screens/scanner_screen.dart';
import '../screens/connect_screen.dart';
import '../screens/settings_screen.dart';
import '../screens/usb_screen.dart';
import '../storage/last_radio_store.dart';
import '../theme/theme_icons.dart';
import '../utils/dialog_utils.dart';
@@ -42,13 +41,15 @@ class _ConnectSheet extends StatelessWidget {
void _chooseRadio(BuildContext context, LastRadio? lastRadio) {
Navigator.of(context).pop();
if (!hostContext.mounted) return;
final usb =
PlatformInfo.isWeb ||
(lastRadio?.transport == LastRadio.transportUsb &&
PlatformInfo.supportsUsbSerial);
final transport = switch (lastRadio?.transport) {
_ when PlatformInfo.isWeb => MeshCoreTransportType.usb,
LastRadio.transportUsb => MeshCoreTransportType.usb,
LastRadio.transportTcp => MeshCoreTransportType.tcp,
_ => MeshCoreTransportType.bluetooth,
};
Navigator.of(hostContext).push(
MaterialPageRoute(
builder: (_) => usb ? const UsbScreen() : const ScannerScreen(),
builder: (_) => ConnectScreen(initialTransport: transport),
),
);
}