Make device discovery asynchronous (#10803)

Migrates DeviceDiscovery.devices and all device-specific lookup to be
asynchronous.
This commit is contained in:
Chris Bracken
2017-06-16 17:47:06 -07:00
committed by GitHub
parent 41e1eb5c64
commit 972be9c8b4
8 changed files with 57 additions and 41 deletions

View File

@@ -37,7 +37,7 @@ class MockPollingDeviceDiscovery extends PollingDeviceDiscovery {
MockPollingDeviceDiscovery() : super('mock');
@override
List<Device> pollingGetDevices() => _devices;
Future<List<Device>> pollingGetDevices() async => _devices;
@override
bool get supportsPlatform => true;
@@ -52,7 +52,7 @@ class MockPollingDeviceDiscovery extends PollingDeviceDiscovery {
}
@override
List<Device> get devices => _devices;
Future<List<Device>> get devices async => _devices;
@override
Stream<Device> get onAdded => _onAddedController.stream;