Even more types

This commit is contained in:
Ian Hickson
2016-03-12 00:32:34 -08:00
parent 229253f43e
commit d745e20853
40 changed files with 240 additions and 228 deletions

View File

@@ -72,11 +72,11 @@ class MockDeviceManager implements DeviceManager {
String specifiedDeviceId;
bool get hasSpecifiedDeviceId => specifiedDeviceId != null;
Future<List<Device>> getAllConnectedDevices() => new Future.value(devices);
Future<List<Device>> getAllConnectedDevices() => new Future<List<Device>>.value(devices);
Future<Device> getDeviceById(String deviceId) {
Device device = devices.firstWhere((Device device) => device.id == deviceId, orElse: () => null);
return new Future.value(device);
return new Future<Device>.value(device);
}
Future<List<Device>> getDevices() async {

View File

@@ -52,7 +52,7 @@ class MockDeviceLogReader extends DeviceLogReader {
final StreamController<String> _linesStreamController =
new StreamController<String>.broadcast();
final Completer _finishedCompleter = new Completer();
final Completer<int> _finishedCompleter = new Completer<int>();
Stream<String> get lines => _linesStreamController.stream;
@@ -62,21 +62,20 @@ class MockDeviceLogReader extends DeviceLogReader {
bool _started = false;
Future start() {
Future<Null> start() async {
assert(!_started);
_started = true;
return new Future.value(this);
}
bool get isReading => _started;
Future stop() {
Future<Null> stop() {
assert(_started);
_started = false;
return new Future.value(this);
return new Future<Null>.value();
}
Future get finished => _finishedCompleter.future;
Future<int> get finished => _finishedCompleter.future;
}
void applyMocksToCommand(FlutterCommand command) {