diff --git a/packages/flutter_tools/lib/src/android/android_emulator.dart b/packages/flutter_tools/lib/src/android/android_emulator.dart index a33dfa7c27a..aee624a55c2 100644 --- a/packages/flutter_tools/lib/src/android/android_emulator.dart +++ b/packages/flutter_tools/lib/src/android/android_emulator.dart @@ -14,7 +14,6 @@ import '../base/file_system.dart'; import '../base/io.dart'; import '../base/logger.dart'; import '../base/process.dart'; -import '../base/utils.dart'; import '../convert.dart'; import '../device.dart'; import '../emulator.dart'; @@ -164,7 +163,7 @@ class AndroidEmulator extends Emulator { .transform(utf8.decoder) .transform(const LineSplitter()) .listen(stderrList.add); - final Future stdioFuture = waitGroup(>[ + final Future stdioFuture = Future.wait(>[ stdoutSubscription.asFuture(), stderrSubscription.asFuture(), ]); diff --git a/packages/flutter_tools/lib/src/android/android_workflow.dart b/packages/flutter_tools/lib/src/android/android_workflow.dart index 4c881ec38b7..4f7bc62353f 100644 --- a/packages/flutter_tools/lib/src/android/android_workflow.dart +++ b/packages/flutter_tools/lib/src/android/android_workflow.dart @@ -13,7 +13,6 @@ import '../base/logger.dart'; import '../base/os.dart'; import '../base/platform.dart'; import '../base/user_messages.dart'; -import '../base/utils.dart'; import '../base/version.dart'; import '../convert.dart'; import '../doctor.dart'; @@ -401,7 +400,7 @@ class AndroidLicenseValidator extends DoctorValidator { // Wait for stdout and stderr to be fully processed, because process.exitCode // may complete first. try { - await waitGroup(>[ + await Future.wait(>[ globals.stdio.addStdoutStream(process.stdout), globals.stdio.addStderrStream(process.stderr), ]); diff --git a/packages/flutter_tools/lib/src/base/common.dart b/packages/flutter_tools/lib/src/base/common.dart index 0951f40001b..6a6a62bc66a 100644 --- a/packages/flutter_tools/lib/src/base/common.dart +++ b/packages/flutter_tools/lib/src/base/common.dart @@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// Whether the tool started from the daemon, as opposed to the command line. -// TODO(jonahwilliams): remove once IDE updates have rolled. -bool isRunningFromDaemon = false; - /// Throw a specialized exception for expected situations /// where the tool should exit with a clear message to the user /// and no stack trace unless the --verbose option is specified. @@ -28,7 +24,7 @@ class ToolExit implements Exception { String toString() => 'Exception: $message'; } -/// Indicates to the linter that the given future is intentionally not `await`-ed. +/// Indicates to the linter that the given future is intentionally not awaited. /// /// Has the same functionality as `unawaited` from `package:pedantic`. /// diff --git a/packages/flutter_tools/lib/src/base/process.dart b/packages/flutter_tools/lib/src/base/process.dart index e72d9846eb1..a910795da9e 100644 --- a/packages/flutter_tools/lib/src/base/process.dart +++ b/packages/flutter_tools/lib/src/base/process.dart @@ -12,7 +12,6 @@ import 'common.dart'; import 'context.dart'; import 'io.dart'; import 'logger.dart'; -import 'utils.dart'; typedef StringConverter = String Function(String string); @@ -529,7 +528,7 @@ class _DefaultProcessUtils implements ProcessUtils { // Wait for stdout to be fully processed // because process.exitCode may complete first causing flaky tests. - await waitGroup(>[ + await Future.wait(>[ stdoutSubscription.asFuture(), stderrSubscription.asFuture(), ]); diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart index 6493940ad94..48fb333f798 100644 --- a/packages/flutter_tools/lib/src/base/utils.dart +++ b/packages/flutter_tools/lib/src/base/utils.dart @@ -153,19 +153,6 @@ Map castStringKeyedMap(dynamic untyped) { return map?.cast(); } -typedef AsyncCallback = Future Function(); - -/// Returns a [Future] that completes when all given [Future]s complete. -/// -/// Uses [Future.wait] but removes null elements from the provided -/// `futures` iterable first. -/// -/// The returned [Future] will be shorter than the given `futures` if -/// it contains nulls. -Future> waitGroup(Iterable> futures) { - return Future.wait(futures.where((Future future) => future != null)); -} - /// Smallest column that will be used for text wrapping. If the requested column /// width is smaller than this, then this is what will be used. const int kMinColumnWidth = 10; diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index a7bdda01a97..527ab3ad1ab 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -50,8 +50,6 @@ class DaemonCommand extends FlutterCommand { @override Future runCommand() async { globals.printStatus('Starting device daemon...'); - isRunningFromDaemon = true; - final Daemon daemon = Daemon( stdinCommandStream, stdoutCommandResponse, notifyingLogger: asLogger(globals.logger),