Change DeviceManager.getAllConnectedDevices() return value from Stream to List (#51015)

This commit is contained in:
Jenn Magder
2020-02-19 17:40:24 -08:00
committed by GitHub
parent 6815e72086
commit 85b54d4c0c
7 changed files with 36 additions and 43 deletions

View File

@@ -201,16 +201,15 @@ class FakeDeviceManager implements DeviceManager {
}
@override
Stream<Device> getAllConnectedDevices() => Stream<Device>.fromIterable(devices);
Future<List<Device>> getAllConnectedDevices() async => devices;
@override
Stream<Device> getDevicesById(String deviceId) {
return Stream<Device>.fromIterable(
devices.where((Device device) => device.id == deviceId));
Future<List<Device>> getDevicesById(String deviceId) async {
return devices.where((Device device) => device.id == deviceId).toList();
}
@override
Stream<Device> getDevices() {
Future<List<Device>> getDevices() {
return hasSpecifiedDeviceId
? getDevicesById(specifiedDeviceId)
: getAllConnectedDevices();