From aecb7d960728849bf636670619b58206ed829c80 Mon Sep 17 00:00:00 2001 From: Keerti Parthasarathy Date: Tue, 12 Jun 2018 09:30:10 -0700 Subject: [PATCH] Fixes for Dart 2 failures in tests (#18371) --- packages/flutter_tools/lib/src/android/android_device.dart | 2 +- packages/flutter_tools/lib/src/device.dart | 2 +- packages/flutter_tools/lib/src/ios/mac.dart | 2 +- packages/flutter_tools/lib/src/ios/simulators.dart | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index 447e29b1e0..041fec8be6 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 @@ class AndroidDevice extends Device { bool get supportsScreenshot => true; @override - Future takeScreenshot(File outputFile) async { + Future takeScreenshot(File outputFile) async { const String remotePath = '/data/local/tmp/flutter_screenshot.png'; await runCheckedAsync(adbCommandForDevice(['shell', 'screencap', '-p', remotePath])); await runCheckedAsync(adbCommandForDevice(['pull', remotePath, outputFile.path])); diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index 108a4391d7..b2009b71c2 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -277,7 +277,7 @@ abstract class Device { bool get supportsScreenshot => false; - Future takeScreenshot(File outputFile) => new Future.error('unimplemented'); + Future takeScreenshot(File outputFile) => new Future.error('unimplemented'); /// Find the apps that are currently running on this device. Future> discoverApps() => diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index 95395773c1..5c8db0d0a6 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -98,7 +98,7 @@ class IMobileDevice { Future startLogger() => runCommand(['idevicesyslog']); /// Captures a screenshot to the specified outputFile. - Future takeScreenshot(File outputFile) { + Future takeScreenshot(File outputFile) { return runCheckedAsync(['idevicescreenshot', outputFile.path]); } } diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index 92d5f10035..cf31675fbd 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -137,7 +137,7 @@ class SimControl { return runCheckedAsync(args); } - Future takeScreenshot(String deviceId, String outputPath) { + Future takeScreenshot(String deviceId, String outputPath) { return runCheckedAsync([_xcrunPath, 'simctl', 'io', deviceId, 'screenshot', outputPath]); } } @@ -458,7 +458,7 @@ class IOSSimulator extends Device { bool get supportsScreenshot => _xcodeVersionSupportsScreenshot; @override - Future takeScreenshot(File outputFile) { + Future takeScreenshot(File outputFile) { return SimControl.instance.takeScreenshot(id, outputFile.path); } }