GNSS szervíz refraktorálás, hibajavítás, PhoneGpsConnection osztály

This commit is contained in:
2026-05-17 15:04:48 +02:00
parent ee0f90e247
commit 24a6b7d513
8 changed files with 221 additions and 112 deletions
+17 -2
View File
@@ -55,7 +55,18 @@ class GnssDevicePickerDialog extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Telefon GPS opció
// 1. ÚJ: GPS kikapcsolása opció
_DeviceTile(
device: const GnssDevice(
address: 'none',
name: 'GPS kikapcsolása (Térkép mód)',
type: GnssConnectionType.none,
),
),
const SizedBox(height: 8),
// 2. Telefon GPS opció
_DeviceTile(
device: const GnssDevice(
address: 'phone',
@@ -210,7 +221,9 @@ class _DeviceTile extends StatelessWidget {
style: const TextStyle(fontSize: 11, color: Colors.grey),
),
],
if (device.type != GnssConnectionType.phoneGps)
// A "none" és a "phoneGps" esetén ne írjunk ki kamucímeket (mint a "phone" vagy "none")
if (device.type != GnssConnectionType.phoneGps &&
device.type != GnssConnectionType.none)
Padding(
padding: const EdgeInsets.only(left: 6),
child: Text(
@@ -231,10 +244,12 @@ class _DeviceTile extends StatelessWidget {
});
}
// Bővítettük a switch utasítást a none opcióval
IconData _iconFor(GnssConnectionType type) => switch (type) {
GnssConnectionType.btSerial => Icons.bluetooth,
GnssConnectionType.ble => Icons.bluetooth_searching,
GnssConnectionType.phoneGps => Icons.phone_android,
GnssConnectionType.none => Icons.gps_off,
};
}