getDevices method
Implementation
Future<List<Device>> getDevices(
{String? type,
Duration timeout = const Duration(seconds: 5),
bool silent = true}) async {
final results = await discoverDevices(type: type, timeout: timeout);
final list = <Device>[];
for (var result in results) {
try {
final device = await result.getRealDevice();
if (device == null) {
continue;
}
list.add(device);
} catch (e) {
if (!silent) {
rethrow;
}
}
}
return list;
}