[flutter_tools] HACKTOBERFEST (#67882)

HACKTOBERFEST
This commit is contained in:
Jonah Williams 2020-10-12 09:31:02 -07:00 committed by GitHub
parent 8211aaa2ae
commit 08576cb671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 146 additions and 148 deletions

View file

@ -258,7 +258,7 @@ Future<int> _exit(int code) async {
globals.printTrace('exiting with code $code');
exit(code);
completer.complete();
// This catches all exceptions becauce the error is propagated on the
// This catches all exceptions because the error is propagated on the
// completer.
} catch (error, stackTrace) { // ignore: avoid_catches_without_on_clauses
completer.completeError(error, stackTrace);

View file

@ -49,7 +49,7 @@ const Map<String, HardwareType> kKnownHardware = <String, HardwareType>{
/// A physical Android device or emulator.
///
/// While [isEmulator] attempts to distinguish between the device categories,
/// this is a best effort process and not a guarantee; certain phyiscal devices
/// this is a best effort process and not a guarantee; certain physical devices
/// identify as emulators. These device identifiers may be added to the [kKnownHardware]
/// map to specify that they are actually physical devices.
class AndroidDevice extends Device {

View file

@ -410,7 +410,7 @@ Future<void> buildGradleApp({
if (exitCode != 0) {
if (detectedGradleError == null) {
BuildEvent('gradle-unkown-failure', flutterUsage: globals.flutterUsage).send();
BuildEvent('gradle-unknown-failure', flutterUsage: globals.flutterUsage).send();
throwToolExit(
'Gradle task $assembleTask failed with exit code $exitCode',
exitCode: exitCode,
@ -608,7 +608,7 @@ Future<void> buildGradleAar({
}
if (buildInfo.dartObfuscation) {
if (buildInfo.mode == BuildMode.debug || buildInfo.mode == BuildMode.profile) {
globals.printStatus('Dart obfuscation is not supported in ${toTitleCase(buildInfo.friendlyModeName)} mode, building as unobfuscated.');
globals.printStatus('Dart obfuscation is not supported in ${toTitleCase(buildInfo.friendlyModeName)} mode, building as un-obfuscated.');
} else {
command.add('-Pdart-obfuscation=true');
}

View file

@ -117,10 +117,10 @@ class AotBuilder {
PerformanceMeasurement aot;
if (expectSo) {
aot = result.performance.values.firstWhere(
(PerformanceMeasurement measurement) => measurement.analyicsName == 'android_aot');
(PerformanceMeasurement measurement) => measurement.analyticsName == 'android_aot');
} else {
aot = result.performance.values.firstWhere(
(PerformanceMeasurement measurement) => measurement.analyicsName == 'ios_aot');
(PerformanceMeasurement measurement) => measurement.analyticsName == 'ios_aot');
}
globals.printStatus('frontend(CompileTime): ${kernel.elapsedMilliseconds} ms.');
globals.printStatus('snapshot(CompileTime): ${aot.elapsedMilliseconds} ms.');

View file

@ -310,9 +310,9 @@ class SizeAnalyzer {
color = TerminalColor.yellow;
}
// Compute any preceeding directories, and compare this to the stored
// directoried (in _leadingPaths) for the last entity that was printed. The
// similary determines whether or not leading directory information needs to
// Compute any preceding directories, and compare this to the stored
// directories (in _leadingPaths) for the last entity that was printed. The
// similarly determines whether or not leading directory information needs to
// be printed.
final List<String> localSegments = entityName.split('/')
..removeLast();

View file

@ -108,7 +108,7 @@ class AzureDetector {
request.headers.add('Metadata', true);
await request.close();
} on SocketException {
// If there is an error on the socket, it probalby means that we are not
// If there is an error on the socket, it probably means that we are not
// running on Azure.
return _isRunningOnAzure = false;
} on HttpException {

View file

@ -270,7 +270,7 @@ class CommandHelpOption {
message.write(''.padLeft(width - parentheticalText.length));
message.write(_terminal.color(parentheticalText, TerminalColor.grey));
// Terminals seem to require this because we have both boldened and colored
// Terminals seem to require this because we have both bolded and colored
// a line. Otherwise the next line comes out bold until a reset bold.
if (_terminal.supportsColor) {
message.write(AnsiTerminal.resetBold);

View file

@ -84,7 +84,7 @@ class Config {
/// Fallback directory in the user's home directory if `XDG_CONFIG_HOME` is
/// not defined.
static const String kXdgConfigFalback = '.config';
static const String kXdgConfigFallback = '.config';
/// The default name for the Flutter config file.
static const String kFlutterSettings = 'settings';

View file

@ -28,7 +28,7 @@ import 'platform.dart';
///
/// Cf. If there is some hope that the tool can continue when an operation fails
/// with an error, then that error/operation should not be handled here. For
/// example, the tool should gernerally be able to continue executing even if it
/// example, the tool should generally be able to continue executing even if it
/// fails to delete a file.
class ErrorHandlingFileSystem extends ForwardingFileSystem {
ErrorHandlingFileSystem({
@ -66,7 +66,7 @@ class ErrorHandlingFileSystem extends ForwardingFileSystem {
/// Delete the file or directory and return true if it exists, take no
/// action and return false if it does not.
///
/// This method should be prefered to checking if it exists and
/// This method should be preferred to checking if it exists and
/// then deleting, because it handles the edge case where the file or directory
/// is deleted by a different program between the two calls.
static bool deleteIfExists(FileSystemEntity file, {bool recursive = false}) {
@ -508,7 +508,7 @@ T _runSync<T>(T Function() op, {
/// as a [ToolExit] using [throwToolExit].
///
/// See also:
/// * [ErrorHandlngFileSystem], for a similar file system strategy.
/// * [ErrorHandlingFileSystem], for a similar file system strategy.
class ErrorHandlingProcessManager extends ProcessManager {
ErrorHandlingProcessManager({
@required ProcessManager delegate,

View file

@ -180,7 +180,7 @@ class LocalFileSystem extends local_fs.LocalFileSystem {
List<ProcessSignal> fatalSignals = Signals.defaultExitSignals,
}) : this._(signals, fatalSignals);
// Unless we're in a test of this class's signal hanlding features, we must
// Unless we're in a test of this class's signal handling features, we must
// have only one instance created with the singleton LocalSignals instance
// and the catchable signals it considers to be fatal.
static LocalFileSystem _instance;

View file

@ -43,7 +43,7 @@ class BuildInfo {
/// If not provided, defaults to [NullSafetyMode.autodetect].
final NullSafetyMode nullSafetyMode;
/// Whether the build should subdset icon fonts.
/// Whether the build should subset icon fonts.
final bool treeShakeIcons;
/// Represents a custom Android product flavor or an Xcode scheme, null for
@ -57,7 +57,7 @@ class BuildInfo {
/// The path to the .packages file to use for compilation.
///
/// This is used by package:package_config to locate the actual package_config.json
/// file. If not provded, defaults to `.packages`.
/// file. If not provided, defaults to `.packages`.
final String packagesPath;
final List<String> fileSystemRoots;
@ -152,14 +152,14 @@ class BuildInfo {
String get modeName => getModeName(mode);
String get friendlyModeName => getFriendlyModeName(mode);
/// the flavor name in the output files is lowercased (see flutter.gradle),
/// the flavor name in the output files is lower-cased (see flutter.gradle),
/// so the lower cased flavor name is used to compute the output file name
String get lowerCasedFlavor => flavor?.toLowerCase();
/// Convert to a structued string encoded structure appropriate for usage as
/// Convert to a structured string encoded structure appropriate for usage as
/// environment variables or to embed in other scripts.
///
/// Fields that are `null` are excluded from this configration.
/// Fields that are `null` are excluded from this configuration.
Map<String, String> toEnvironmentConfig() {
return <String, String>{
if (dartDefines?.isNotEmpty ?? false)
@ -425,7 +425,7 @@ enum TargetPlatform {
fuchsia_x64,
tester,
web_javascript,
// The arch specific android target platforms are soft-depreacted.
// The arch specific android target platforms are soft-deprecated.
// Instead of using TargetPlatform as a combination arch + platform
// the code will be updated to carry arch information in [DarwinArch]
// and [AndroidArch].

View file

@ -835,7 +835,7 @@ class _BuildInstance {
elapsedMilliseconds: stopwatch.elapsedMilliseconds,
skipped: skipped,
succeeded: succeeded,
analyicsName: node.target.analyticsName,
analyticsName: node.target.analyticsName,
);
}
return succeeded;
@ -864,14 +864,14 @@ class PerformanceMeasurement {
@required this.elapsedMilliseconds,
@required this.skipped,
@required this.succeeded,
@required this.analyicsName,
@required this.analyticsName,
});
final int elapsedMilliseconds;
final String target;
final bool skipped;
final bool succeeded;
final String analyicsName;
final String analyticsName;
}
/// Check if there are any dependency cycles in the target.
@ -1062,7 +1062,7 @@ class Node {
}
}
// If we depend on a file that doesnt exist on disk, mark the build as
// If we depend on a file that doesn't exist on disk, mark the build as
// dirty. if the rule is not correctly specified, this will result in it
// always being rerun.
if (missingInputs.isNotEmpty) {

View file

@ -101,7 +101,7 @@ class DepfileService {
.map<String>((String path) => path.replaceAllMapped(_escapeExpr, (Match match) => match.group(1)).trim())
.where((String path) => path.isNotEmpty)
// The tool doesn't write duplicates to these lists. This call is an attempt to
// be resillient to the outputs of other tools which write or user edits to depfiles.
// be resilient to the outputs of other tools which write or user edits to depfiles.
.toSet()
.map(_fileSystem.file)
.toList();

View file

@ -170,7 +170,7 @@ class AndroidAot extends AotElfBase {
/// The selected build mode.
///
/// This is restricted to [BuildMode.profile] or [BuildMode.relese].
/// This is restricted to [BuildMode.profile] or [BuildMode.release].
final BuildMode buildMode;
@override

View file

@ -176,7 +176,7 @@ DevFSContent processSkSLBundle(String bundlePath, {
bundle['platform'] as String);
if (bundleTargetPlatform != targetPlatform) {
logger.printError(
'The SkSL bundle was created for $bundleTargetPlatform, but the curent '
'The SkSL bundle was created for $bundleTargetPlatform, but the current '
'platform is $targetPlatform. This may lead to less efficient shader '
'caching.'
);

View file

@ -165,7 +165,7 @@ class ReleaseCopyFlutterBundle extends CopyFlutterBundle {
///
/// Note that this target depends on the `.dart_tool/package_config.json` file
/// even though it is not listed as an input. Pub inserts a timestamp into
/// the file which causes unecessary rebuilds, so instead a subset of the contents
/// the file which causes unnecessary rebuilds, so instead a subset of the contents
/// are used an input instead.
class KernelSnapshot extends Target {
const KernelSnapshot();

View file

@ -132,7 +132,7 @@ class IconTreeShaker {
if (fonts.length != iconData.length) {
environment.logger.printStatus(
'Expected to find fonts for ${iconData.keys}, but found '
'${fonts.keys}. This usually means you are refering to '
'${fonts.keys}. This usually means you are referring to '
'font families in an IconData class but not including them '
'in the assets section of your pubspec.yaml, are missing '
'the package that would include them, or are missing '
@ -219,7 +219,7 @@ class IconTreeShaker {
return true;
}
/// Returns a map of { fontFamly: relativePath } pairs.
/// Returns a map of { fontFamily: relativePath } pairs.
Future<Map<String, String>> _parseFontJson(
String fontManifestData,
Set<String> families,
@ -303,9 +303,9 @@ class IconTreeShaker {
return _parseConstFinderResult(constFinderResult);
}
Map<String, List<int>> _parseConstFinderResult(_ConstFinderResult consts) {
Map<String, List<int>> _parseConstFinderResult(_ConstFinderResult constants) {
final Map<String, List<int>> result = <String, List<int>>{};
for (final Map<String, dynamic> iconDataMap in consts.constantInstances) {
for (final Map<String, dynamic> iconDataMap in constants.constantInstances) {
if ((iconDataMap['fontPackage'] ?? '') is! String || // Null is ok here.
iconDataMap['fontFamily'] is! String ||
iconDataMap['codePoint'] is! num) {

View file

@ -187,8 +187,8 @@ class AotAssemblyProfile extends AotAssemblyBase {
}
/// Create a trivial App.framework file for debug iOS builds.
class DebugUniveralFramework extends Target {
const DebugUniveralFramework();
class DebugUniversalFramework extends Target {
const DebugUniversalFramework();
@override
String get name => 'debug_universal_framework';
@ -375,7 +375,7 @@ class DebugIosApplicationBundle extends IosAssetBundle {
@override
List<Target> get dependencies => <Target>[
const DebugUniveralFramework(),
const DebugUniversalFramework(),
...super.dependencies,
];
}

View file

@ -197,7 +197,7 @@ class LocalizationOptions {
/// The `--header-file` argument.
///
/// A file containing the header to preprend to the generated
/// A file containing the header to prepend to the generated
/// Dart localizations.
final Uri headerFile;

View file

@ -37,7 +37,7 @@ const String kDart2jsOptimization = 'Dart2jsOptimization';
const String kCspMode = 'cspMode';
/// The caching strategy to use for service worker generation.
const String kServiceWorkerStrategy = 'ServiceWorkerStratgey';
const String kServiceWorkerStrategy = 'ServiceWorkerStrategy';
/// Whether the dart2js build should output source maps.
const String kSourceMapsEnabled = 'SourceMaps';
@ -55,7 +55,7 @@ const String kOfflineFirst = 'offline-first';
const String kNoneWorker = 'none';
/// Convert a [value] into a [ServiceWorkerStrategy].
ServiceWorkerStrategy _serviceWorkerStrategyfromString(String value) {
ServiceWorkerStrategy _serviceWorkerStrategyFromString(String value) {
switch (value) {
case kNoneWorker:
return ServiceWorkerStrategy.none;
@ -429,7 +429,7 @@ class WebServiceWorker extends Target {
final File serviceWorkerFile = environment.outputDir
.childFile('flutter_service_worker.js');
final Depfile depfile = Depfile(contents, <File>[serviceWorkerFile]);
final ServiceWorkerStrategy serviceWorkerStrategy = _serviceWorkerStrategyfromString(
final ServiceWorkerStrategy serviceWorkerStrategy = _serviceWorkerStrategyFromString(
environment.defines[kServiceWorkerStrategy],
);
final String serviceWorker = generateServiceWorker(

View file

@ -647,7 +647,7 @@ abstract class CachedArtifact extends ArtifactSet {
/// Ensures that the source files for all of the dependencies for the
/// flutter_tool are present.
///
/// This does not handle cases wheere the source files are modified or the
/// This does not handle cases where the source files are modified or the
/// directory contents are incomplete.
class PubDependencies extends ArtifactSet {
PubDependencies({
@ -1370,7 +1370,7 @@ class IosUsbArtifacts extends CachedArtifact {
// For unknown reasons, users are getting into bad states where libimobiledevice is
// downloaded but some executables are missing from the zip. The names here are
// used for additional download checks below, so we can redownload if they are
// used for additional download checks below, so we can re-download if they are
// missing.
static const Map<String, List<String>> _kExecutables = <String, List<String>>{
'libimobiledevice': <String>[

View file

@ -120,15 +120,15 @@ class AssembleCommand extends FlutterCommand {
@override
Future<Map<CustomDimensions, String>> get usageValues async {
final FlutterProject futterProject = FlutterProject.current();
if (futterProject == null) {
final FlutterProject flutterProject = FlutterProject.current();
if (flutterProject == null) {
return const <CustomDimensions, String>{};
}
try {
final Environment localEnvironment = createEnvironment();
return <CustomDimensions, String>{
CustomDimensions.commandBuildBundleTargetPlatform: localEnvironment.defines['TargetPlatform'],
CustomDimensions.commandBuildBundleIsModule: '${futterProject.isModule}',
CustomDimensions.commandBuildBundleIsModule: '${flutterProject.isModule}',
};
} on Exception {
// We've failed to send usage.
@ -285,7 +285,7 @@ void writePerformanceData(Iterable<PerformanceMeasurement> measurements, File ou
'targets': <Object>[
for (final PerformanceMeasurement measurement in measurements)
<String, Object>{
'name': measurement.analyicsName,
'name': measurement.analyticsName,
'skipped': measurement.skipped,
'succeeded': measurement.succeeded,
'elapsedMilliseconds': measurement.elapsedMilliseconds,

View file

@ -79,13 +79,13 @@ class BuildBundleCommand extends BuildSubCommand {
@override
Future<Map<CustomDimensions, String>> get usageValues async {
final String projectDir = globals.fs.file(targetFile).parent.parent.path;
final FlutterProject futterProject = FlutterProject.fromPath(projectDir);
if (futterProject == null) {
final FlutterProject flutterProject = FlutterProject.fromPath(projectDir);
if (flutterProject == null) {
return const <CustomDimensions, String>{};
}
return <CustomDimensions, String>{
CustomDimensions.commandBuildBundleTargetPlatform: stringArg('target-platform'),
CustomDimensions.commandBuildBundleIsModule: '${futterProject.isModule}',
CustomDimensions.commandBuildBundleIsModule: '${flutterProject.isModule}',
};
}

View file

@ -82,7 +82,7 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
help: 'Produce xcframeworks that include all valid architectures (Xcode 11 or later).',
)
..addFlag('cocoapods',
help: 'Produce a Flutter.podspec instead of an engine Flutter.framework (recomended if host app uses CocoaPods).',
help: 'Produce a Flutter.podspec instead of an engine Flutter.framework (recommended if host app uses CocoaPods).',
)
..addOption('output',
abbr: 'o',

View file

@ -42,7 +42,7 @@ class BuildWebCommand extends BuildSubCommand {
defaultsTo: false,
help: 'Whether to generate a sourcemap file. These can be used by browsers '
'To view and debug the original source code of a compiled and minified Dart '
'application. Defaults to false (no sourcemaps produced).'
'application. Defaults to false (i.e. no sourcemaps produced).'
);
argParser.addOption('pwa-strategy',
defaultsTo: kOfflineFirst,

View file

@ -27,7 +27,7 @@ class DoctorCommand extends FlutterCommand {
@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async => <DevelopmentArtifact>{
// This is required because the gradle hostonly tests do not correctly specify
// This is required because the gradle host-only tests do not correctly specify
// their dependencies.
DevelopmentArtifact.androidGenSnapshot,
};

View file

@ -98,9 +98,9 @@ class DowngradeCommand extends FlutterCommand {
'to switch to an official channel.',
);
}
final String lastFlutterVesion = _persistentToolState.lastActiveVersion(channel);
final String lastFlutterVersion = _persistentToolState.lastActiveVersion(channel);
final String currentFlutterVersion = _flutterVersion.frameworkRevision;
if (lastFlutterVesion == null || currentFlutterVersion == lastFlutterVesion) {
if (lastFlutterVersion == null || currentFlutterVersion == lastFlutterVersion) {
final String trailing = await _createErrorMessage(workingDirectory, channel);
throwToolExit(
'There is no previously recorded version for channel "$currentChannel".\n'
@ -108,9 +108,9 @@ class DowngradeCommand extends FlutterCommand {
);
}
// Detect unkown versions.
// Detect unknown versions.
final RunResult parseResult = await _processUtils.run(<String>[
'git', 'describe', '--tags', lastFlutterVesion,
'git', 'describe', '--tags', lastFlutterVersion,
], workingDirectory: workingDirectory);
if (parseResult.exitCode != 0) {
throwToolExit('Failed to parse version for downgrade:\n${parseResult.stderr}');
@ -137,7 +137,7 @@ class DowngradeCommand extends FlutterCommand {
// so this operation is safe.
try {
await _processUtils.run(
<String>['git', 'reset', '--hard', lastFlutterVesion],
<String>['git', 'reset', '--hard', lastFlutterVersion],
throwOnError: true,
workingDirectory: workingDirectory,
);

View file

@ -47,7 +47,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
..addFlag('dump-skp-on-shader-compilation',
negatable: false,
help: 'Automatically dump the skp that triggers new shader compilations. '
'This is useful for wrting custom ShaderWarmUp to reduce jank. '
'This is useful for writing custom ShaderWarmUp to reduce jank. '
'By default, this is not enabled to reduce the overhead. '
'This is only available in profile or debug build. ',
)
@ -141,7 +141,7 @@ class RunCommand extends RunCommandBase {
help: 'Enable tracing to the endless tracer. This is useful when '
'recording huge amounts of traces. If we need to use endless buffer to '
'record startup traces, we can combine the ("--trace-startup"). '
'For exemple, flutter run --trace-startup --endless-trace-buffer. ',
'For example, flutter run --trace-startup --endless-trace-buffer. ',
)
..addFlag('trace-systrace',
negatable: false,

View file

@ -14,10 +14,10 @@ import '../base/io.dart';
import '../convert.dart';
import '../runner/flutter_command.dart';
/// Support for symbolicating a Dart stack trace.
/// Support for symbolizing a Dart stack trace.
///
/// This command accepts either paths to an input file containing the
/// stack trace and an output file for the symbolicated trace to be
/// stack trace and an output file for the symbolizing trace to be
/// written, or it accepts a stack trace over stdin and outputs it
/// over stdout.
class SymbolizeCommand extends FlutterCommand {
@ -43,7 +43,7 @@ class SymbolizeCommand extends FlutterCommand {
argParser.addOption(
'output',
abbr: 'o',
valueHelp: 'A file path for a symbolicated stack trace to be written to.'
valueHelp: 'A file path for a symbolized stack trace to be written to.'
);
}
@ -63,7 +63,7 @@ class SymbolizeCommand extends FlutterCommand {
@override
Future<void> validateCommand() {
if (!argResults.wasParsed('debug-info')) {
throwToolExit('"--debug-info" is required to symbolicate stack traces.');
throwToolExit('"--debug-info" is required to symbolize stack traces.');
}
if (!_fileSystem.isFileSync(stringArg('debug-info'))) {
throwToolExit('${stringArg('debug-info')} does not exist.');

View file

@ -518,7 +518,7 @@ enum DependencyKind {
// "sdk" dependency in the dependency_overrides section.
overridden,
// A depdendency that uses git.
// A dependency that uses git.
git,
}
@ -812,7 +812,7 @@ class PubspecYaml {
// Since we're in one of the places where we can list dependencies,
// remember this as the current last known valid place to insert our
// transitive dev dependencies. If the section is for regular dependencies,
// then also rememeber the line for the end of direct dependencies.
// then also remember the line for the end of direct dependencies.
if (section == Section.dependencies) {
endOfDirectDependencies = output.length;
}

View file

@ -37,7 +37,7 @@ class UpgradeCommand extends FlutterCommand {
..addOption(
'working-directory',
hide: true,
help: 'Override the upgrade working directoy for integration testing.'
help: 'Override the upgrade working directory for integration testing.'
);
}
@ -124,7 +124,7 @@ class UpgradeCommandRunner {
}
// If there are uncommitted changes we might be on the right commit but
// we should still warn.
if (!force && await hasUncomittedChanges()) {
if (!force && await hasUncommittedChanges()) {
throwToolExit(
'Your flutter checkout has local changes that would be erased by '
'upgrading. If you want to keep these changes, it is recommended that '
@ -178,7 +178,7 @@ class UpgradeCommandRunner {
globals.persistentToolState.redisplayWelcomeMessage = true;
}
Future<bool> hasUncomittedChanges() async {
Future<bool> hasUncommittedChanges() async {
try {
final RunResult result = await processUtils.run(
<String>['git', 'status', '-s'],

View file

@ -866,7 +866,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
}
}
/// Convert a file URI into a multiroot scheme URI if provided, otherwise
/// Convert a file URI into a multi-root scheme URI if provided, otherwise
/// return unmodified.
@visibleForTesting
String toMultiRootPath(Uri fileUri, String scheme, List<String> fileSystemRoots, bool windows) {

View file

@ -242,7 +242,7 @@ class _DevFSHttpWriter implements DevFSWriter {
final String fsName;
final Uri httpAddress;
// 3 was chosen to try to limit the varience in the time it takes to execute
// 3 was chosen to try to limit the variance in the time it takes to execute
// `await request.close()` since there is a known bug in Dart where it doesn't
// always return a status code in response to a PUT request:
// https://github.com/dart-lang/sdk/issues/43525.

View file

@ -81,7 +81,7 @@ class PlatformType {
String toString() => value;
}
/// A disovery mechanism for flutter-supported development devices.
/// A discovery mechanism for flutter-supported development devices.
abstract class DeviceManager {
DeviceManager({
@required Logger logger,
@ -238,7 +238,7 @@ abstract class DeviceManager {
// Always remove web and fuchsia devices from `--all`. This setting
// currently requires devices to share a frontend_server and resident
// runnner instance. Both web and fuchsia require differently configured
// runner instance. Both web and fuchsia require differently configured
// compilers, and web requires an entirely different resident runner.
if (hasSpecifiedAllDevices) {
devices = <Device>[
@ -270,7 +270,7 @@ abstract class DeviceManager {
// If there are still multiple devices and the user did not specify to run
// all, then attempt to prioritize ephemeral devices. For example, if the
// user only typed 'flutter run' and both an Android device and desktop
// device are availible, choose the Android device.
// device are available, choose the Android device.
if (devices.length > 1 && !hasSpecifiedAllDevices) {
// Note: ephemeral is nullable for device types where this is not well
// defined.
@ -626,7 +626,7 @@ abstract class Device {
/// Create a platform-specific [DevFSWriter] for the given [app], or
/// null if the device does not support them.
///
/// For example, the destkop device classes can use a writer which
/// For example, the desktop device classes can use a writer which
/// copies the files across the local file system.
DevFSWriter createDevFSWriter(
covariant ApplicationPackage app,
@ -685,7 +685,7 @@ abstract class Device {
bool get supportsHotRestart => true;
/// Whether flutter applications running on this device can be terminated
/// from the vmservice.
/// from the VM Service.
bool get supportsFlutterExit => true;
/// Whether the device supports taking screenshots of a running flutter
@ -938,7 +938,7 @@ class DebuggingOptions {
/// Enable expression evaluation for web target.
final bool webEnableExpressionEvaluation;
/// A file where the vmservice URL should be written after the application is started.
/// A file where the VM Service URL should be written after the application is started.
final String vmserviceOutFile;
final bool fastStart;

View file

@ -596,7 +596,7 @@ class ValidationResult {
/// on the cause and/or solution to the validation failure.
@immutable
class ValidationMessage {
/// Create a validation message with information for a passing validatior.
/// Create a validation message with information for a passing validator.
///
/// By default this is not displayed unless the doctor is run in
/// verbose mode.
@ -663,7 +663,7 @@ class ValidationMessage {
int get hashCode => type.hashCode ^ message.hashCode ^ contextUrl.hashCode;
}
/// A validator that checks the version of Flutter, as well as some auxillary information
/// A validator that checks the version of Flutter, as well as some auxiliary information
/// such as the pub or Flutter cache overrides.
///
/// This is primarily useful for diagnosing issues on Github bug reports by displaying

View file

@ -237,7 +237,7 @@ abstract class EmulatorDiscovery {
/// Whether this emulator discovery is capable of listing any emulators.
bool get canListAnything;
/// Whether this emulator discovery is capabale of launching new emulators.
/// Whether this emulator discovery is capable of launching new emulators.
bool get canLaunchAnything;
Future<List<Emulator>> get emulators;

View file

@ -320,7 +320,7 @@ class FuchsiaDevice extends Device {
}
packageRepo.createSync(recursive: true);
} on Exception catch (e) {
globals.printError('Failed to create Fuchisa package repo directory '
globals.printError('Failed to create Fuchsia package repo directory '
'at ${packageRepo.path}: $e');
return LaunchResult.failed();
}
@ -440,7 +440,7 @@ class FuchsiaDevice extends Device {
}
if (debuggingOptions.buildInfo.mode.isRelease) {
globals.printTrace('App succesfully started in a release mode.');
globals.printTrace('App successfully started in a release mode.');
return LaunchResult.succeeded();
}
globals.printTrace('App started in a non-release mode. Setting up vmservice connection.');

View file

@ -38,7 +38,7 @@ class FuchsiaKernelCompiler {
mode: buildInfo.mode,
);
if (!globals.fs.isFileSync(kernelCompiler)) {
throwToolExit('Fuchisa kernel compiler not found at "$kernelCompiler"');
throwToolExit('Fuchsia kernel compiler not found at "$kernelCompiler"');
}
final String platformDill = globals.artifacts.getArtifactPath(
Artifact.platformKernelDill,
@ -46,7 +46,7 @@ class FuchsiaKernelCompiler {
mode: buildInfo.mode,
);
if (!globals.fs.isFileSync(platformDill)) {
throwToolExit('Fuchisa platform file not found at "$platformDill"');
throwToolExit('Fuchsia platform file not found at "$platformDill"');
}
List<String> flags = <String>[
'--target', 'flutter_runner',

View file

@ -76,7 +76,7 @@ class FuchsiaPM {
/// When successful, creates a file `app_name-0.far` under [buildPath], which
/// is the Fuchsia package.
///
/// [buildPath] should be the same path passed to [init], and [manfiestPath]
/// [buildPath] should be the same path passed to [init], and [manifestPath]
/// should be the same manifest passed to [build].
Future<bool> archive(String buildPath, String keyPath, String manifestPath) {
return _runPMCommand(<String>[

View file

@ -251,9 +251,9 @@ class IntelliJValidatorOnMac extends IntelliJValidator {
for (final Directory dir in installDirs) {
checkForIntelliJ(dir);
if (!dir.path.endsWith('.app')) {
for (final FileSystemEntity subdir in dir.listSync()) {
if (subdir is Directory) {
checkForIntelliJ(subdir);
for (final FileSystemEntity subdirectory in dir.listSync()) {
if (subdirectory is Directory) {
checkForIntelliJ(subdirectory);
}
}
}

View file

@ -887,7 +887,7 @@ class IOSDevicePortForwarder extends DevicePortForwarder {
while (!connected) {
_logger.printTrace('Attempting to forward device port $devicePort to host port $hostPort');
process = await _iproxy.forward(devicePort, hostPort, _id);
// TODO(ianh): This is a flakey race condition, https://github.com/libimobiledevice/libimobiledevice/issues/674
// TODO(ianh): This is a flaky race condition, https://github.com/libimobiledevice/libimobiledevice/issues/674
connected = !await process.stdout.isEmpty.timeout(_kiProxyPortForwardTimeout, onTimeout: () => false);
if (!connected) {
process.kill();
@ -919,7 +919,7 @@ class IOSDevicePortForwarder extends DevicePortForwarder {
return;
}
_logger.printTrace('Unforwarding port $forwardedPort');
_logger.printTrace('Un-forwarding port $forwardedPort');
forwardedPort.dispose();
}

View file

@ -502,7 +502,7 @@ class XcodeProjectInfo {
/// Checks whether the [buildConfigurations] contains the specified string, without
/// regard to case.
bool hasBuildConfiguratinForBuildMode(String buildMode) {
bool hasBuildConfigurationForBuildMode(String buildMode) {
buildMode = buildMode.toLowerCase();
for (final String name in buildConfigurations) {
if (name.toLowerCase() == buildMode) {
@ -537,7 +537,7 @@ class XcodeProjectInfo {
/// null, if there is no unique best match.
String buildConfigurationFor(BuildInfo buildInfo, String scheme) {
final String expectedConfiguration = expectedBuildConfigurationFor(buildInfo, scheme);
if (hasBuildConfiguratinForBuildMode(expectedConfiguration)) {
if (hasBuildConfigurationForBuildMode(expectedConfiguration)) {
return expectedConfiguration;
}
final String baseConfiguration = _baseConfigurationFor(buildInfo);

View file

@ -431,7 +431,7 @@ class WebAssetServer implements AssetReader {
final int length = file.lengthSync();
// Attempt to determine the file's mime type. if this is not provided some
// browsers will refuse to render images/show video et cetera. If the tool
// browsers will refuse to render images/show video etc. If the tool
// cannot determine a mime type, fall back to application/octet-stream.
String mimeType;
if (length >= 12) {
@ -544,7 +544,7 @@ class WebAssetServer implements AssetReader {
return modules;
}
/// Whether to use the cavaskit SDK for rendering.
/// Whether to use the canvaskit SDK for rendering.
bool canvasKitRendering = false;
shelf.Response _serveIndex() {
@ -864,9 +864,9 @@ class WebDevFS implements DevFS {
}
// The tool generates an entrypoint file in a temp directory to handle
// the web specific bootrstrap logic. To make it easier for DWDS to handle
// the web specific bootstrap logic. To make it easier for DWDS to handle
// mapping the file name, this is done via an additional file root and
// specicial hard-coded scheme.
// special hard-coded scheme.
final CompilerOutput compilerOutput = await generator.recompile(
Uri(
scheme: 'org-dartlang-app',

View file

@ -104,7 +104,7 @@ const Set<String> _validNumberFormats = <String>{
// The names of the NumberFormat factory constructors which have named
// parameters rather than positional parameters.
//
// This helps the tool correctly generate number formmatting code correctly.
// This helps the tool correctly generate number formatting code correctly.
//
// Example of code that uses named parameters:
// final NumberFormat format = NumberFormat.compact(
@ -176,7 +176,7 @@ class OptionalParameter {
// Each placeholder can optionally specify a valid Dart type. If the type
// is NumberFormat or DateFormat then a format which matches one of the
// type's factory constructors can also be specified. In this example the
// date placeholder is to be formated with DateFormat.yMMMMd:
// date placeholder is to be formatted with DateFormat.yMMMMd:
//
// "helloWorldOn": "Hello World on {date}",
// "@helloWorldOn": {

View file

@ -238,7 +238,7 @@ String describeLocale(String tag) {
return output;
}
/// Return the input string as a Dart-parseable string.
/// Return the input string as a Dart-parsable string.
///
/// ```
/// foo => 'foo'

View file

@ -67,7 +67,7 @@ enum CocoaPodsStatus {
brokenInstall,
}
/// Cocoapods is a depenency management solution for iOS and macOS applications.
/// Cocoapods is a dependency management solution for iOS and macOS applications.
///
/// Cocoapods is generally installed via ruby gems and interacted with via
/// the `pod` CLI command.

View file

@ -77,7 +77,7 @@ class MacOSDevice extends DesktopDevice {
void onAttached(covariant MacOSApp package, BuildMode buildMode, Process process) {
// Bring app to foreground. Ideally this would be done post-launch rather
// than post-attach, since this won't run for release builds, but there's
// no general-purpose way of knowing when a process is far enoug along in
// no general-purpose way of knowing when a process is far enough along in
// the launch process for 'open' to foreground it.
_processManager.run(<String>[
'open', package.applicationBundle(buildMode),

View file

@ -10,9 +10,6 @@ import '../features.dart';
/// The macOS-specific implementation of a [Workflow].
///
/// This workflow requires the flutter-desktop-embedding as a sibling
/// repository to the flutter repo.
class MacOSWorkflow implements Workflow {
const MacOSWorkflow({
@required Platform platform,

View file

@ -14,7 +14,7 @@ const String kPluginClass = 'pluginClass';
/// Constant for 'pluginClass' key in plugin maps.
const String kDartPluginClass = 'dartPluginClass';
/// Marker interface for all platform specific plugin config impls.
/// Marker interface for all platform specific plugin config implementations.
abstract class PluginPlatform {
const PluginPlatform();

View file

@ -937,7 +937,7 @@ Future<void> _writeIOSPluginRegistrant(FlutterProject project, List<Plugin> plug
/// that file, rather than the generated file.
String _cmakeRelativePluginSymlinkDirectoryPath(CmakeBasedProject project) {
final String makefileDirPath = project.cmakeFile.parent.absolute.path;
// CMake alway uses posix-style path separators, regardless of the platform.
// CMake always uses posix-style path separators, regardless of the platform.
final path.Context cmakePathContext = path.Context(style: path.Style.posix);
final List<String> relativePathComponents = globals.fs.path.split(globals.fs.path.relative(
project.pluginSymlinkDirectory.absolute.path,

View file

@ -343,7 +343,7 @@ abstract class CmakeBasedProject {
/// the build.
File get generatedCmakeConfigFile;
/// Includable CMake with rules and variables for plugin builds.
/// Included CMake with rules and variables for plugin builds.
File get generatedPluginCmakeFile;
/// The directory to write plugin symlinks.

View file

@ -328,7 +328,7 @@ class FlutterDevice {
return vmService.onDone
.catchError((dynamic error, StackTrace stackTrace) {
globals.logger.printError(
'unhanlded error waiting for vm service exit:\n $error',
'unhandled error waiting for vm service exit:\n $error',
stackTrace: stackTrace,
);
})
@ -1083,7 +1083,7 @@ abstract class ResidentRunner {
/// If the device has a connected vmservice, this method will attempt to hide
/// and restore the debug banner before taking the screenshot.
///
/// Throws an [AssertionError] if [Devce.supportsScreenshot] is not true.
/// Throws an [AssertionError] if [Device.supportsScreenshot] is not true.
Future<void> screenshot(FlutterDevice device) async {
assert(device.device.supportsScreenshot);

View file

@ -536,7 +536,7 @@ class HotRunner extends ResidentRunner {
// The engine handles killing and recreating isolates that it has spawned
// ("uiIsolates"). The isolates that were spawned from these uiIsolates
// will not be restared, and so they must be manually killed.
// will not be restarted, and so they must be manually killed.
final vm_service.VM vm = await device.vmService.getVM();
for (final vm_service.IsolateRef isolateRef in vm.isolates) {
if (uiIsolatesIds.contains(isolateRef.id)) {
@ -570,7 +570,7 @@ class HotRunner extends ResidentRunner {
try {
await device.vmService.streamListen('Isolate');
} on vm_service.RPCError {
// Do nothing, we're already subcribed.
// Do nothing, we're already subscribed.
}
isolateNotifications.add(
device.vmService.onIsolateEvent.firstWhere((vm_service.Event event) {

View file

@ -553,7 +553,7 @@ abstract class FlutterCommand extends Command<void> {
argParser.addFlag(FlutterOptions.kNullAssertions,
help:
'Perform additional null assertions on the boundaries of migrated and '
'unmigrated code. This setting is not currently supported on desktop '
'un-migrated code. This setting is not currently supported on desktop '
'devices.'
);
}
@ -598,7 +598,7 @@ abstract class FlutterCommand extends Command<void> {
FlutterOptions.kPerformanceMeasurementFile,
help:
'The name of a file where flutter assemble performance and '
'cachedness information will be written in a JSON format.'
'cached-ness information will be written in a JSON format.'
);
}
@ -1186,7 +1186,7 @@ mixin TargetPlatformBasedDevelopmentArtifacts on FlutterCommand {
@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async {
// If there is no specified target device, fallback to the default
// confiugration.
// configuration.
final String rawTargetPlatform = stringArg('target-platform');
final TargetPlatform targetPlatform = getTargetPlatformForName(rawTargetPlatform);
if (targetPlatform == null) {

View file

@ -279,7 +279,7 @@ void _buildCoverageMap(
final List<int> hits = (coverage['hits'] as List<dynamic>).cast<int>();
final List<int> misses = (coverage['misses'] as List<dynamic>).cast<int>();
final List<dynamic> tokenPositions = scripts[scriptRef['id']]['tokenPosTable'] as List<dynamic>;
// The token positions can be null if the script has no coverable lines.
// The token positions can be null if the script has no lines that may be covered.
if (tokenPositions == null) {
continue;
}

View file

@ -77,7 +77,7 @@ class FlutterVersion {
_frameworkVersion = gitTagVersion.frameworkVersionFor(_frameworkRevision);
}
/// Fetchs tags from the upstream Flutter repository and re-calculates the
/// Fetches tags from the upstream Flutter repository and re-calculates the
/// version.
///
/// This carries a performance penalty, and should only be called when the
@ -259,7 +259,7 @@ class FlutterVersion {
);
} on VersionCheckError catch (error) {
if (globals.platform.environment.containsKey('FLUTTER_GIT_URL')) {
globals.logger.printError('Warning: the Flutter git upstream was overriden '
globals.logger.printError('Warning: the Flutter git upstream was overridden '
'by the environment variable FLUTTER_GIT_URL = $_flutterGit');
}
globals.logger.printError(error.toString());

View file

@ -421,10 +421,10 @@ extension FlutterVmService on vm_service.VmService {
});
}
/// Retreive the cached SkSL shaders from an attached Flutter view.
/// Retrieve the cached SkSL shaders from an attached Flutter view.
///
/// This method will only return data if `--cache-sksl` was provided as a
/// flutter run agument, and only then on physical devices.
/// flutter run argument, and only then on physical devices.
Future<Map<String, Object>> getSkSLs({
@required String viewId,
}) async {
@ -437,7 +437,7 @@ extension FlutterVmService on vm_service.VmService {
return response.json['SkSLs'] as Map<String, Object>;
}
/// Flush all tasks on the UI thead for an attached Flutter view.
/// Flush all tasks on the UI thread for an attached Flutter view.
///
/// This method is currently used only for benchmarking.
Future<void> flushUIThreadTasks({
@ -809,7 +809,7 @@ Future<String> sharedSkSlWriter(Device device, Map<String, Object> data, {
}) async {
if (data.isEmpty) {
globals.logger.printStatus(
'No data was receieved. To ensure SkSL data can be generated use a '
'No data was received. To ensure SkSL data can be generated use a '
'physical device then:\n'
' 1. Pass "--cache-sksl" as an argument to flutter run.\n'
' 2. Interact with the application to force shaders to be compiled.\n'

View file

@ -52,6 +52,7 @@ String generateMainModule({
@required String entrypoint,
@required bool nullAssertions,
}) {
// TODO(jonahwilliams): fix typo in dwds and update.
return '''/* ENTRYPOINT_EXTENTION_MARKER */
// Create the main module loaded below.
define("main_module.bootstrap", ["$entrypoint", "dart_sdk"], function(app, dart_sdk) {

View file

@ -162,13 +162,13 @@ class ChromiumLauncher {
/// Launch a Chromium browser to a particular `host` page.
///
/// `headless` defaults to false, and controls whether we open a headless or
/// a `headfull` browser.
/// [headless] defaults to false, and controls whether we open a headless or
/// a "headfull" browser.
///
/// `debugPort` is Chrome's debugging protocol port. If null, a random free
/// [debugPort] is Chrome's debugging protocol port. If null, a random free
/// port is picked automatically.
///
/// `skipCheck` does not attempt to make a devtools connection before returning.
/// [skipCheck] does not attempt to make a devtools connection before returning.
Future<Chromium> launch(String url, {
bool headless = false,
int debugPort,

View file

@ -8,7 +8,7 @@ import '../base/platform.dart';
import '../doctor.dart';
import 'chrome.dart';
/// A validator for Chromium-based brosers.
/// A validator for Chromium-based browsers.
abstract class ChromiumValidator extends DoctorValidator {
const ChromiumValidator(String title) : super(title);
@ -19,25 +19,25 @@ abstract class ChromiumValidator extends DoctorValidator {
@override
Future<ValidationResult> validate() async {
final bool canRunChromium = _chromiumLauncher.canFindExecutable();
final String chromimSearchLocation = _chromiumLauncher.findExecutable();
final String chromiumSearchLocation = _chromiumLauncher.findExecutable();
final List<ValidationMessage> messages = <ValidationMessage>[
if (_platform.environment.containsKey(kChromeEnvironment))
if (!canRunChromium)
ValidationMessage.hint('$chromimSearchLocation is not executable.')
ValidationMessage.hint('$chromiumSearchLocation is not executable.')
else
ValidationMessage('$kChromeEnvironment = $chromimSearchLocation')
ValidationMessage('$kChromeEnvironment = $chromiumSearchLocation')
else
if (!canRunChromium)
ValidationMessage.hint('Cannot find $_name. Try setting '
'$kChromeEnvironment to a $_name executable.')
else
ValidationMessage('$_name at $chromimSearchLocation'),
ValidationMessage('$_name at $chromiumSearchLocation'),
];
if (!canRunChromium) {
return ValidationResult(
ValidationType.missing,
messages,
statusInfo: 'Cannot find $_name executable at $chromimSearchLocation',
statusInfo: 'Cannot find $_name executable at $chromiumSearchLocation',
);
}
return ValidationResult(
@ -66,7 +66,7 @@ class ChromeValidator extends ChromiumValidator {
String get _name => 'Chrome';
}
/// A validator that checks whethere Edge is installed and can run.
/// A validator that checks whether Edge is installed and can run.
class EdgeValidator extends ChromiumValidator {
const EdgeValidator({
@required Platform platform,

View file

@ -36,7 +36,7 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {
'to learn about adding Windows support to a project.');
}
// Ensure that necessary emphemeral files are generated and up to date.
// Ensure that necessary ephemeral files are generated and up to date.
_writeGeneratedFlutterConfig(windowsProject, buildInfo, target);
createPluginSymlinks(windowsProject.parent);

View file

@ -140,7 +140,7 @@ class VisualStudio {
return _requiredComponents().values.toList();
}
/// The consumer-facing version name of the minumum supported version.
/// The consumer-facing version name of the minimum supported version.
///
/// E.g., for Visual Studio 2019 this returns "2019" rather than "16".
String get minimumVersionDescription {
@ -199,7 +199,7 @@ class VisualStudio {
Map<String, String> _requiredComponents([int majorVersion]) {
// The description of the C++ toolchain required by the template. The
// component name is significantly different in different versions.
// When a new major version of VS is supported, its toochain description
// When a new major version of VS is supported, its toolchain description
// should be added below. It should also be made the default, so that when
// there is no installation, the message shows the string that will be
// relevant for the most likely fresh install case).
@ -228,7 +228,7 @@ class VisualStudio {
/// The minimum supported major version.
static const int _minimumSupportedVersion = 16; // '16' is VS 2019.
/// vswhere argument to specificy the minimum version.
/// vswhere argument to specify the minimum version.
static const String _vswhereMinVersionArgument = '-version';
/// vswhere argument to allow prerelease versions.
@ -304,7 +304,7 @@ class VisualStudio {
}
}
} on ArgumentError {
// Thrown if vswhere doesnt' exist; ignore and return null below.
// Thrown if vswhere doesn't exist; ignore and return null below.
} on ProcessException {
// Ignored, return null below.
} on FormatException {

View file

@ -106,7 +106,7 @@ void main() {
return BuildResult(success: true, performance: <String, PerformanceMeasurement>{
'hello': PerformanceMeasurement(
target: 'hello',
analyicsName: 'bar',
analyticsName: 'bar',
elapsedMilliseconds: 123,
skipped: false,
succeeded: true,
@ -208,7 +208,7 @@ void main() {
testWithoutContext('writePerformanceData outputs performance data in JSON form', () {
final List<PerformanceMeasurement> performanceMeasurement = <PerformanceMeasurement>[
PerformanceMeasurement(
analyicsName: 'foo',
analyticsName: 'foo',
target: 'hidden',
skipped: false,
succeeded: true,

View file

@ -63,7 +63,7 @@ void main() {
final Future<void> result = createTestCommandRunner(command)
.run(const <String>['symbolize']);
expect(result, throwsToolExit(message: '"--debug-info" is required to symbolicate stack traces.'));
expect(result, throwsToolExit(message: '"--debug-info" is required to symbolize stack traces.'));
});
testUsingContext('symbolize exits when --debug-info file is missing', () async {

View file

@ -369,7 +369,7 @@ class FakeUpgradeCommandRunner extends UpgradeCommandRunner {
Future<String> fetchRemoteRevision() async => remoteRevision;
@override
Future<bool> hasUncomittedChanges() async => willHaveUncomittedChanges;
Future<bool> hasUncommittedChanges() async => willHaveUncomittedChanges;
@override
Future<void> upgradeChannel(FlutterVersion flutterVersion) async {}

View file

@ -115,7 +115,7 @@ void main() {
]),
]);
await const DebugUniveralFramework().build(environment);
await const DebugUniversalFramework().build(environment);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,

View file

@ -116,14 +116,14 @@ void main() {
.thenAnswer((Invocation invocation) async {
return BuildResult(success: true, performance: <String, PerformanceMeasurement>{
'kernel_snapshot': PerformanceMeasurement(
analyicsName: 'kernel_snapshot',
analyticsName: 'kernel_snapshot',
target: 'kernel_snapshot',
elapsedMilliseconds: 1000,
succeeded: true,
skipped: false,
),
'anything': PerformanceMeasurement(
analyicsName: 'android_aot',
analyticsName: 'android_aot',
target: 'anything',
elapsedMilliseconds: 1000,
succeeded: true,

View file

@ -1457,7 +1457,7 @@ void main() {
]);
await residentRunner.writeSkSL();
expect(testLogger.statusText, contains('No data was receieved'));
expect(testLogger.statusText, contains('No data was received'));
expect(fakeVmServiceHost.hasRemainingExpectations, false);
}));