fix(ios): show FTMS trainers advertised as 16-bit UUID
This commit is contained in:
@ -137,8 +137,7 @@ class _BikeScanDialogState extends ConsumerState<BikeScanDialog> {
|
||||
const SizedBox(height: 12),
|
||||
itemBuilder: (context, index) {
|
||||
final device = devices[index];
|
||||
final isFtms = device.serviceUuids
|
||||
.contains(Uuid.parse(ftmsServiceUuid));
|
||||
final isFtms = _advertisesFtms(device);
|
||||
return Material(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
@ -268,7 +267,6 @@ class _BikeScanDialogState extends ConsumerState<BikeScanDialog> {
|
||||
}
|
||||
|
||||
List<DiscoveredDevice> _filteredDevices(List<DiscoveredDevice> devices) {
|
||||
final ftmsUuid = Uuid.parse(ftmsServiceUuid);
|
||||
return devices.where((device) {
|
||||
if (device.id == widget.excludedDeviceId) {
|
||||
return false;
|
||||
@ -276,9 +274,14 @@ class _BikeScanDialogState extends ConsumerState<BikeScanDialog> {
|
||||
if (_showAll) {
|
||||
return true;
|
||||
}
|
||||
return device.serviceUuids.contains(ftmsUuid);
|
||||
return _advertisesFtms(device);
|
||||
}).toList(growable: false);
|
||||
}
|
||||
|
||||
bool _advertisesFtms(DiscoveredDevice device) {
|
||||
return device.serviceUuids.any(isFtmsUuid) ||
|
||||
device.serviceData.keys.any(isFtmsUuid);
|
||||
}
|
||||
}
|
||||
|
||||
class _DialogHeader extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user