Fixes for Dart 2 failures in tests (#18371)
diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart
index 447e29b..041fec8 100644
--- a/packages/flutter_tools/lib/src/android/android_device.dart
+++ b/packages/flutter_tools/lib/src/android/android_device.dart
@@ -510,7 +510,7 @@
bool get supportsScreenshot => true;
@override
- Future<Null> takeScreenshot(File outputFile) async {
+ Future<void> takeScreenshot(File outputFile) async {
const String remotePath = '/data/local/tmp/flutter_screenshot.png';
await runCheckedAsync(adbCommandForDevice(<String>['shell', 'screencap', '-p', remotePath]));
await runCheckedAsync(adbCommandForDevice(<String>['pull', remotePath, outputFile.path]));
diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart
index 108a439..b2009b7 100644
--- a/packages/flutter_tools/lib/src/device.dart
+++ b/packages/flutter_tools/lib/src/device.dart
@@ -277,7 +277,7 @@
bool get supportsScreenshot => false;
- Future<Null> takeScreenshot(File outputFile) => new Future<Null>.error('unimplemented');
+ Future<void> takeScreenshot(File outputFile) => new Future<Null>.error('unimplemented');
/// Find the apps that are currently running on this device.
Future<List<DiscoveredApp>> discoverApps() =>
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index 9539577..5c8db0d 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -98,7 +98,7 @@
Future<Process> startLogger() => runCommand(<String>['idevicesyslog']);
/// Captures a screenshot to the specified outputFile.
- Future<Null> takeScreenshot(File outputFile) {
+ Future<void> takeScreenshot(File outputFile) {
return runCheckedAsync(<String>['idevicescreenshot', outputFile.path]);
}
}
diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart
index 92d5f10..cf31675 100644
--- a/packages/flutter_tools/lib/src/ios/simulators.dart
+++ b/packages/flutter_tools/lib/src/ios/simulators.dart
@@ -137,7 +137,7 @@
return runCheckedAsync(args);
}
- Future<Null> takeScreenshot(String deviceId, String outputPath) {
+ Future<void> takeScreenshot(String deviceId, String outputPath) {
return runCheckedAsync(<String>[_xcrunPath, 'simctl', 'io', deviceId, 'screenshot', outputPath]);
}
}
@@ -458,7 +458,7 @@
bool get supportsScreenshot => _xcodeVersionSupportsScreenshot;
@override
- Future<Null> takeScreenshot(File outputFile) {
+ Future<void> takeScreenshot(File outputFile) {
return SimControl.instance.takeScreenshot(id, outputFile.path);
}
}