mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[flutter_tools] remove unused or no longer useful code (#69547)
This commit is contained in:
parent
a2a4e9eda4
commit
fb90544cab
@ -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<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen(stderrList.add);
|
||||
final Future<void> stdioFuture = waitGroup<void>(<Future<void>>[
|
||||
final Future<void> stdioFuture = Future.wait<void>(<Future<void>>[
|
||||
stdoutSubscription.asFuture<void>(),
|
||||
stderrSubscription.asFuture<void>(),
|
||||
]);
|
||||
|
||||
@ -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<void>(<Future<void>>[
|
||||
await Future.wait<void>(<Future<void>>[
|
||||
globals.stdio.addStdoutStream(process.stdout),
|
||||
globals.stdio.addStderrStream(process.stderr),
|
||||
]);
|
||||
|
||||
@ -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`.
|
||||
///
|
||||
|
||||
@ -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<void>(<Future<void>>[
|
||||
await Future.wait<void>(<Future<void>>[
|
||||
stdoutSubscription.asFuture<void>(),
|
||||
stderrSubscription.asFuture<void>(),
|
||||
]);
|
||||
|
||||
@ -153,19 +153,6 @@ Map<String, dynamic> castStringKeyedMap(dynamic untyped) {
|
||||
return map?.cast<String, dynamic>();
|
||||
}
|
||||
|
||||
typedef AsyncCallback = Future<void> 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<List>] will be shorter than the given `futures` if
|
||||
/// it contains nulls.
|
||||
Future<List<T>> waitGroup<T>(Iterable<Future<T>> futures) {
|
||||
return Future.wait<T>(futures.where((Future<T> 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;
|
||||
|
||||
@ -50,8 +50,6 @@ class DaemonCommand extends FlutterCommand {
|
||||
@override
|
||||
Future<FlutterCommandResult> runCommand() async {
|
||||
globals.printStatus('Starting device daemon...');
|
||||
isRunningFromDaemon = true;
|
||||
|
||||
final Daemon daemon = Daemon(
|
||||
stdinCommandStream, stdoutCommandResponse,
|
||||
notifyingLogger: asLogger<NotifyingLogger>(globals.logger),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user