format parameter list (#27261)
diff --git a/packages/flutter_tools/lib/runner.dart b/packages/flutter_tools/lib/runner.dart index fdcca4b..621cf63 100644 --- a/packages/flutter_tools/lib/runner.dart +++ b/packages/flutter_tools/lib/runner.dart
@@ -68,13 +68,13 @@ } Future<int> _handleToolError( - dynamic error, - StackTrace stackTrace, - bool verbose, - List<String> args, - bool reportCrashes, - String getFlutterVersion(), - ) async { + dynamic error, + StackTrace stackTrace, + bool verbose, + List<String> args, + bool reportCrashes, + String getFlutterVersion(), +) async { if (error is UsageException) { printError('${error.message}\n'); printError("Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.");
diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index 88214bd..73aa44b 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart
@@ -490,7 +490,7 @@ } @override - DeviceLogReader getLogReader({ApplicationPackage app}) { + DeviceLogReader getLogReader({ ApplicationPackage app }) { // The Android log reader isn't app-specific. _logReader ??= _AdbLogReader(this); return _logReader; @@ -576,7 +576,8 @@ /// of devices and possible device issue diagnostics. Either argument can be null, /// in which case information for that parameter won't be populated. @visibleForTesting -void parseADBDeviceOutput(String text, { +void parseADBDeviceOutput( + String text, { List<AndroidDevice> devices, List<String> diagnostics }) { @@ -849,7 +850,7 @@ } @override - Future<int> forward(int devicePort, {int hostPort}) async { + Future<int> forward(int devicePort, { int hostPort }) async { hostPort ??= 0; final RunResult process = await runCheckedAsync(device.adbCommandForDevice( <String>['forward', 'tcp:$hostPort', 'tcp:$devicePort']
diff --git a/packages/flutter_tools/lib/src/android/android_sdk.dart b/packages/flutter_tools/lib/src/android/android_sdk.dart index f97cc5b..0bb5823 100644 --- a/packages/flutter_tools/lib/src/android/android_sdk.dart +++ b/packages/flutter_tools/lib/src/android/android_sdk.dart
@@ -46,7 +46,7 @@ /// This should be used over accessing androidSdk.adbPath directly because it /// will work for those users who have Android Platform Tools installed but /// not the full SDK. -String getAdbPath([AndroidSdk existingSdk]) { +String getAdbPath([ AndroidSdk existingSdk ]) { if (existingSdk?.adbPath != null) return existingSdk.adbPath; @@ -63,7 +63,7 @@ /// This should be used over accessing androidSdk.emulatorPath directly because it /// will work for those users who have Android Tools installed but /// not the full SDK. -String getEmulatorPath([AndroidSdk existingSdk]) { +String getEmulatorPath([ AndroidSdk existingSdk ]) { return existingSdk?.emulatorPath ?? AndroidSdk.locateAndroidSdk()?.emulatorPath; } @@ -100,7 +100,7 @@ /// This should be used over accessing androidSdk.avdManagerPath directly because it /// will work for those users who have Android Tools installed but /// not the full SDK. -String getAvdManagerPath([AndroidSdk existingSdk]) { +String getAvdManagerPath([ AndroidSdk existingSdk ]) { return existingSdk?.avdManagerPath ?? AndroidSdk.locateAndroidSdk()?.avdManagerPath; }
diff --git a/packages/flutter_tools/lib/src/android/android_studio.dart b/packages/flutter_tools/lib/src/android/android_studio.dart index a94b200..58c7ca0 100644 --- a/packages/flutter_tools/lib/src/android/android_studio.dart +++ b/packages/flutter_tools/lib/src/android/android_studio.dart
@@ -219,7 +219,7 @@ static List<AndroidStudio> _allLinuxOrWindows() { final List<AndroidStudio> studios = <AndroidStudio>[]; - bool _hasStudioAt(String path, {Version newerThan}) { + bool _hasStudioAt(String path, { Version newerThan }) { return studios.any((AndroidStudio studio) { if (studio.directory != path) return false;
diff --git a/packages/flutter_tools/lib/src/android/gradle.dart b/packages/flutter_tools/lib/src/android/gradle.dart index fbde2ed..ae2b9fb 100644 --- a/packages/flutter_tools/lib/src/android/gradle.dart +++ b/packages/flutter_tools/lib/src/android/gradle.dart
@@ -353,11 +353,12 @@ } Future<void> _buildGradleProjectV2( - FlutterProject flutterProject, - String gradle, - BuildInfo buildInfo, - String target, - bool isBuildingBundle) async { + FlutterProject flutterProject, + String gradle, + BuildInfo buildInfo, + String target, + bool isBuildingBundle, +) async { final GradleProject project = await _gradleProject(); String assembleTask;
diff --git a/packages/flutter_tools/lib/src/application_package.dart b/packages/flutter_tools/lib/src/application_package.dart index 989ca6f..e274519 100644 --- a/packages/flutter_tools/lib/src/application_package.dart +++ b/packages/flutter_tools/lib/src/application_package.dart
@@ -26,8 +26,9 @@ static ApplicationPackageFactory get instance => context[ApplicationPackageFactory]; Future<ApplicationPackage> getPackageForPlatform( - TargetPlatform platform, - {File applicationBinary}) async { + TargetPlatform platform, { + File applicationBinary, + }) async { switch (platform) { case TargetPlatform.android_arm: case TargetPlatform.android_arm64:
diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart index 9bf9280..fad2228 100644 --- a/packages/flutter_tools/lib/src/artifacts.dart +++ b/packages/flutter_tools/lib/src/artifacts.dart
@@ -30,7 +30,7 @@ kernelWorkerSnapshot, } -String _artifactToFileName(Artifact artifact, [TargetPlatform platform, BuildMode mode]) { +String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { switch (artifact) { case Artifact.genSnapshot: return 'gen_snapshot'; @@ -101,18 +101,18 @@ } // Returns the requested [artifact] for the [platform] and [mode] combination. - String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]); + String getArtifactPath(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]); // Returns which set of engine artifacts is currently used for the [platform] // and [mode] combination. - String getEngineType(TargetPlatform platform, [BuildMode mode]); + String getEngineType(TargetPlatform platform, [ BuildMode mode ]); } /// Manages the engine artifacts downloaded to the local cache. class CachedArtifacts extends Artifacts { @override - String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]) { + String getArtifactPath(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { platform ??= _currentHostPlatform; switch (platform) { case TargetPlatform.android_arm: @@ -135,7 +135,7 @@ } @override - String getEngineType(TargetPlatform platform, [BuildMode mode]) { + String getEngineType(TargetPlatform platform, [ BuildMode mode ]) { return fs.path.basename(_getEngineArtifactsPath(platform, mode)); } @@ -207,7 +207,7 @@ } } - String _getEngineArtifactsPath(TargetPlatform platform, [BuildMode mode]) { + String _getEngineArtifactsPath(TargetPlatform platform, [ BuildMode mode ]) { final String engineDir = cache.getArtifactDirectory('engine').path; final String platformName = getNameForTargetPlatform(platform); switch (platform) { @@ -252,7 +252,7 @@ String _hostEngineOutPath; @override - String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]) { + String getArtifactPath(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { switch (artifact) { case Artifact.snapshotDart: return fs.path.join(_engineSrcPath, 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact)); @@ -287,7 +287,7 @@ } @override - String getEngineType(TargetPlatform platform, [BuildMode mode]) { + String getEngineType(TargetPlatform platform, [ BuildMode mode ]) { return fs.path.basename(engineOutPath); } @@ -340,7 +340,7 @@ final File flutterPatchedSdk; @override - String getArtifactPath(Artifact artifact, [TargetPlatform platform, BuildMode mode]) { + String getArtifactPath(Artifact artifact, [ TargetPlatform platform, BuildMode mode ]) { if (artifact == Artifact.frontendServerSnapshotForEngineDartSdk && frontendServer != null) { return frontendServer.path; } @@ -357,5 +357,5 @@ } @override - String getEngineType(TargetPlatform platform, [BuildMode mode]) => parent.getEngineType(platform, mode); + String getEngineType(TargetPlatform platform, [ BuildMode mode ]) => parent.getEngineType(platform, mode); }
diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart index d97d81b..574e92d 100644 --- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart
@@ -36,7 +36,7 @@ bool wasBuiltOnce(); - bool needsBuild({String manifestPath = _ManifestAssetBundle.defaultManifestPath}); + bool needsBuild({ String manifestPath = _ManifestAssetBundle.defaultManifestPath }); /// Returns 0 for success; non-zero for failure. Future<int> build({ @@ -75,7 +75,7 @@ bool wasBuiltOnce() => _lastBuildTimestamp != null; @override - bool needsBuild({String manifestPath = defaultManifestPath}) { + bool needsBuild({ String manifestPath = defaultManifestPath }) { if (_lastBuildTimestamp == null) return true; @@ -303,9 +303,9 @@ /// Returns a DevFSContent representing the license file. Future<DevFSContent> _obtainLicenses( PackageMap packageMap, - String assetBase, - { bool reportPackages } -) async { + String assetBase, { + bool reportPackages, +}) async { // Read the LICENSE file from each package in the .packages file, splitting // each one into each component license (so that we can de-dupe if possible). // @@ -564,7 +564,8 @@ return result; } -void _parseAssetsFromFolder(PackageMap packageMap, +void _parseAssetsFromFolder( + PackageMap packageMap, FlutterManifest flutterManifest, String assetBase, _AssetDirectoryCache cache, @@ -595,7 +596,8 @@ } } -void _parseAssetFromFile(PackageMap packageMap, +void _parseAssetFromFile( + PackageMap packageMap, FlutterManifest flutterManifest, String assetBase, _AssetDirectoryCache cache,
diff --git a/packages/flutter_tools/lib/src/base/file_system.dart b/packages/flutter_tools/lib/src/base/file_system.dart index 3123e35..5bb23ab 100644 --- a/packages/flutter_tools/lib/src/base/file_system.dart +++ b/packages/flutter_tools/lib/src/base/file_system.dart
@@ -68,7 +68,7 @@ /// specified for each source/destination file pair. /// /// Creates `destDir` if needed. -void copyDirectorySync(Directory srcDir, Directory destDir, [void onFileCopied(File srcFile, File destFile)]) { +void copyDirectorySync(Directory srcDir, Directory destDir, [ void onFileCopied(File srcFile, File destFile) ]) { if (!srcDir.existsSync()) throw Exception('Source directory "${srcDir.path}" does not exist, nothing to copy'); @@ -151,7 +151,7 @@ /// Returns true, if [entity] does not exist. /// /// Returns false, if [entity] exists, but [referenceFile] does not. -bool isOlderThanReference({@required FileSystemEntity entity, @required File referenceFile}) { +bool isOlderThanReference({ @required FileSystemEntity entity, @required File referenceFile }) { if (!entity.existsSync()) return true; return referenceFile.existsSync()
diff --git a/packages/flutter_tools/lib/src/base/io.dart b/packages/flutter_tools/lib/src/base/io.dart index a3de883..862f43b 100644 --- a/packages/flutter_tools/lib/src/base/io.dart +++ b/packages/flutter_tools/lib/src/base/io.dart
@@ -95,7 +95,7 @@ /// Sets the [exit] function to a function that throws an exception rather /// than exiting the process; this is intended for testing purposes. @visibleForTesting -void setExitFunctionForTests([ExitFunction exitFunction]) { +void setExitFunctionForTests([ ExitFunction exitFunction ]) { _exitFunction = exitFunction ?? (int exitCode) { throw ProcessExit(exitCode, immediate: true); };
diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart index f0585de..dc8fca3 100644 --- a/packages/flutter_tools/lib/src/base/logger.dart +++ b/packages/flutter_tools/lib/src/base/logger.dart
@@ -389,7 +389,7 @@ )..start(); } - void _emit(_LogType type, String message, [StackTrace stackTrace]) { + void _emit(_LogType type, String message, [ StackTrace stackTrace ]) { if (message.trim().isEmpty) return;
diff --git a/packages/flutter_tools/lib/src/base/net.dart b/packages/flutter_tools/lib/src/base/net.dart index 5196fc79..742bd8b 100644 --- a/packages/flutter_tools/lib/src/base/net.dart +++ b/packages/flutter_tools/lib/src/base/net.dart
@@ -33,7 +33,7 @@ Future<bool> doesRemoteFileExist(Uri url) async => (await _attempt(url, onlyHeaders: true)) != null; -Future<List<int>> _attempt(Uri url, {bool onlyHeaders = false}) async { +Future<List<int>> _attempt(Uri url, { bool onlyHeaders = false }) async { printTrace('Downloading: $url'); HttpClient httpClient; if (context[HttpClientFactory] != null) {
diff --git a/packages/flutter_tools/lib/src/base/os.dart b/packages/flutter_tools/lib/src/base/os.dart index 54f5964..4cb0e5c 100644 --- a/packages/flutter_tools/lib/src/base/os.dart +++ b/packages/flutter_tools/lib/src/base/os.dart
@@ -68,7 +68,7 @@ return osNames.containsKey(osName) ? osNames[osName] : osName; } - List<File> _which(String execName, {bool all = false}); + List<File> _which(String execName, { bool all = false }); /// Returns the separator between items in the PATH environment variable. String get pathVarSeparator; @@ -83,7 +83,7 @@ } @override - List<File> _which(String execName, {bool all = false}) { + List<File> _which(String execName, { bool all = false }) { final List<String> command = <String>['which']; if (all) command.add('-a'); @@ -159,7 +159,7 @@ } @override - List<File> _which(String execName, {bool all = false}) { + List<File> _which(String execName, { bool all = false }) { // `where` always returns all matches, not just the first one. final ProcessResult result = processManager.runSync(<String>['where', execName]); if (result.exitCode != 0) @@ -264,7 +264,7 @@ /// directory or the current working directory if none specified. /// Return null if the project root could not be found /// or if the project root is the flutter repository root. -String findProjectRoot([String directory]) { +String findProjectRoot([ String directory ]) { const String kProjectRootSentinel = 'pubspec.yaml'; directory ??= fs.currentDirectory.path; while (true) {
diff --git a/packages/flutter_tools/lib/src/base/process.dart b/packages/flutter_tools/lib/src/base/process.dart index 0e18d38..fff1252 100644 --- a/packages/flutter_tools/lib/src/base/process.dart +++ b/packages/flutter_tools/lib/src/base/process.dart
@@ -94,7 +94,7 @@ printTrace('Shutdown hooks complete'); } -Map<String, String> _environment(bool allowReentrantFlutter, [Map<String, String> environment]) { +Map<String, String> _environment(bool allowReentrantFlutter, [ Map<String, String> environment ]) { if (allowReentrantFlutter) { if (environment == null) environment = <String, String>{ 'FLUTTER_ALREADY_LOCKED': 'true' }; @@ -107,7 +107,8 @@ /// This runs the command in the background from the specified working /// directory. Completes when the process has been started. -Future<Process> runCommand(List<String> cmd, { +Future<Process> runCommand( + List<String> cmd, { String workingDirectory, bool allowReentrantFlutter = false, Map<String, String> environment @@ -128,7 +129,8 @@ /// If [filter] is non-null, all lines that do not match it are removed. If /// [mapFunction] is present, all lines that match [filter] are also forwarded /// to [mapFunction] for further processing. -Future<int> runCommandAndStreamOutput(List<String> cmd, { +Future<int> runCommandAndStreamOutput( + List<String> cmd, { String workingDirectory, bool allowReentrantFlutter = false, String prefix = '', @@ -187,7 +189,8 @@ /// Runs the [command] interactively, connecting the stdin/stdout/stderr /// streams of this process to those of the child process. Completes with /// the exit code of the child process. -Future<int> runInteractively(List<String> command, { +Future<int> runInteractively( + List<String> command, { String workingDirectory, bool allowReentrantFlutter = false, Map<String, String> environment @@ -219,7 +222,8 @@ return proc; } -Future<RunResult> runAsync(List<String> cmd, { +Future<RunResult> runAsync( + List<String> cmd, { String workingDirectory, bool allowReentrantFlutter = false, Map<String, String> environment @@ -235,7 +239,8 @@ return runResults; } -Future<RunResult> runCheckedAsync(List<String> cmd, { +Future<RunResult> runCheckedAsync( + List<String> cmd, { String workingDirectory, bool allowReentrantFlutter = false, Map<String, String> environment @@ -274,7 +279,8 @@ /// Run cmd and return stdout. /// /// Throws an error if cmd exits with a non-zero value. -String runCheckedSync(List<String> cmd, { +String runCheckedSync( + List<String> cmd, { String workingDirectory, bool allowReentrantFlutter = false, bool hideStdout = false, @@ -292,7 +298,8 @@ } /// Run cmd and return stdout. -String runSync(List<String> cmd, { +String runSync( + List<String> cmd, { String workingDirectory, bool allowReentrantFlutter = false }) { @@ -312,7 +319,8 @@ } } -String _runWithLoggingSync(List<String> cmd, { +String _runWithLoggingSync( + List<String> cmd, { bool checked = false, bool noisyErrors = false, bool throwStandardErrorOnError = false,
diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart index 2062631..a309293 100644 --- a/packages/flutter_tools/lib/src/base/utils.dart +++ b/packages/flutter_tools/lib/src/base/utils.dart
@@ -79,7 +79,7 @@ final RegExp _upperRegex = RegExp(r'[A-Z]'); /// Convert `fooBar` to `foo_bar`. -String snakeCase(String str, [String sep = '_']) { +String snakeCase(String str, [ String sep = '_' ]) { return str.replaceAllMapped(_upperRegex, (Match m) => '${m.start == 0 ? '' : sep}${m[0].toLowerCase()}'); } @@ -343,7 +343,7 @@ /// /// The [indent] and [hangingIndent] must be smaller than [columnWidth] when /// added together. -String wrapText(String text, {int columnWidth, int hangingIndent, int indent, bool shouldWrap}) { +String wrapText(String text, { int columnWidth, int hangingIndent, int indent, bool shouldWrap }) { if (text == null || text.isEmpty) { return ''; } @@ -431,7 +431,7 @@ /// If [outputPreferences.wrapText] is false, then the text will be returned /// simply split at the newlines, but not wrapped. If [shouldWrap] is specified, /// then it overrides the [outputPreferences.wrapText] setting. -List<String> _wrapTextAsLines(String text, {int start = 0, int columnWidth, bool shouldWrap}) { +List<String> _wrapTextAsLines(String text, { int start = 0, int columnWidth, bool shouldWrap }) { if (text == null || text.isEmpty) { return <String>['']; } @@ -491,7 +491,7 @@ return result; } - String joinRun(List<_AnsiRun> list, int start, [int end]) { + String joinRun(List<_AnsiRun> list, int start, [ int end ]) { return list.sublist(start, end).map<String>((_AnsiRun run) => run.original).join().trim(); }
diff --git a/packages/flutter_tools/lib/src/bundle.dart b/packages/flutter_tools/lib/src/bundle.dart index 2d810a8..ac3d219 100644 --- a/packages/flutter_tools/lib/src/bundle.dart +++ b/packages/flutter_tools/lib/src/bundle.dart
@@ -22,7 +22,7 @@ const String defaultManifestPath = 'pubspec.yaml'; String get defaultDepfilePath => fs.path.join(getBuildDirectory(), 'snapshot_blob.bin.d'); -String getDefaultApplicationKernelPath({@required bool trackWidgetCreation}) { +String getDefaultApplicationKernelPath({ @required bool trackWidgetCreation }) { return getKernelPathForTransformerOptions( fs.path.join(getBuildDirectory(), 'app.dill'), trackWidgetCreation: trackWidgetCreation, @@ -222,7 +222,9 @@ } Future<void> writeBundle( - Directory bundleDir, Map<String, DevFSContent> assetEntries) async { + Directory bundleDir, + Map<String, DevFSContent> assetEntries, +) async { if (bundleDir.existsSync()) bundleDir.deleteSync(recursive: true); bundleDir.createSync(recursive: true);
diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index fe5089e..e1c1641 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart
@@ -524,8 +524,10 @@ } } - Future<bool> areRemoteArtifactsAvailable({String engineVersion, - bool includeAllPlatforms = true}) async { + Future<bool> areRemoteArtifactsAvailable({ + String engineVersion, + bool includeAllPlatforms = true, + }) async { final bool includeAllPlatformsState = cache.includeAllPlatforms; cache.includeAllPlatforms = includeAllPlatforms;
diff --git a/packages/flutter_tools/lib/src/commands/attach.dart b/packages/flutter_tools/lib/src/commands/attach.dart index 81cfd2b..6f4dc41 100644 --- a/packages/flutter_tools/lib/src/commands/attach.dart +++ b/packages/flutter_tools/lib/src/commands/attach.dart
@@ -275,18 +275,19 @@ } class HotRunnerFactory { - HotRunner build(List<FlutterDevice> devices, { - String target, - DebuggingOptions debuggingOptions, - bool usesTerminalUI = true, - bool benchmarkMode = false, - File applicationBinary, - bool hostIsIde = false, - String projectRootPath, - String packagesFilePath, - String dillOutputPath, - bool stayResident = true, - bool ipv6 = false, + HotRunner build( + List<FlutterDevice> devices, { + String target, + DebuggingOptions debuggingOptions, + bool usesTerminalUI = true, + bool benchmarkMode = false, + File applicationBinary, + bool hostIsIde = false, + String projectRootPath, + String packagesFilePath, + String dillOutputPath, + bool stayResident = true, + bool ipv6 = false, }) => HotRunner( devices, target: target,
diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart index 2a13c4c..53fdd7b 100644 --- a/packages/flutter_tools/lib/src/commands/create.dart +++ b/packages/flutter_tools/lib/src/commands/create.dart
@@ -395,7 +395,7 @@ return null; } - Future<int> _generateModule(Directory directory, Map<String, dynamic> templateContext, {bool overwrite = false}) async { + Future<int> _generateModule(Directory directory, Map<String, dynamic> templateContext, { bool overwrite = false }) async { int generatedCount = 0; final String description = argResults.wasParsed('description') ? argResults['description'] @@ -414,7 +414,7 @@ return generatedCount; } - Future<int> _generatePackage(Directory directory, Map<String, dynamic> templateContext, {bool overwrite = false}) async { + Future<int> _generatePackage(Directory directory, Map<String, dynamic> templateContext, { bool overwrite = false }) async { int generatedCount = 0; final String description = argResults.wasParsed('description') ? argResults['description'] @@ -431,7 +431,7 @@ return generatedCount; } - Future<int> _generatePlugin(Directory directory, Map<String, dynamic> templateContext, {bool overwrite = false}) async { + Future<int> _generatePlugin(Directory directory, Map<String, dynamic> templateContext, { bool overwrite = false }) async { int generatedCount = 0; final String description = argResults.wasParsed('description') ? argResults['description'] @@ -463,7 +463,7 @@ return generatedCount; } - Future<int> _generateApp(Directory directory, Map<String, dynamic> templateContext, {bool overwrite = false}) async { + Future<int> _generateApp(Directory directory, Map<String, dynamic> templateContext, { bool overwrite = false }) async { int generatedCount = 0; generatedCount += _renderTemplate('app', directory, templateContext, overwrite: overwrite); final FlutterProject project = await FlutterProject.fromDirectory(directory); @@ -536,7 +536,7 @@ }; } - int _renderTemplate(String templateName, Directory directory, Map<String, dynamic> context, {bool overwrite = false}) { + int _renderTemplate(String templateName, Directory directory, Map<String, dynamic> context, { bool overwrite = false }) { final Template template = Template.fromName(templateName); return template.render(directory, context, overwriteExisting: overwrite); }
diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index a632028..3e522a8 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart
@@ -161,7 +161,7 @@ void _send(Map<String, dynamic> map) => sendCommand(map); - void shutdown({dynamic error}) { + void shutdown({ dynamic error }) { _commandSubscription?.cancel(); for (Domain domain in _domainMap.values) domain.dispose(); @@ -210,7 +210,7 @@ }); } - void sendEvent(String name, [dynamic args]) { + void sendEvent(String name, [ dynamic args ]) { final Map<String, dynamic> map = <String, dynamic>{ 'event': name }; if (args != null) map['params'] = _toJsonable(args); @@ -333,8 +333,12 @@ final List<AppInstance> _apps = <AppInstance>[]; Future<AppInstance> startApp( - Device device, String projectDirectory, String target, String route, - DebuggingOptions options, bool enableHotReload, { + Device device, + String projectDirectory, + String target, + String route, + DebuggingOptions options, + bool enableHotReload, { File applicationBinary, @required bool trackWidgetCreation, String projectRootPath, @@ -405,13 +409,14 @@ } Future<AppInstance> launch( - ResidentRunner runner, - _RunOrAttach runOrAttach, - Device device, - String projectDirectory, - bool enableHotReload, - Directory cwd, - LaunchMode launchMode) async { + ResidentRunner runner, + _RunOrAttach runOrAttach, + Device device, + String projectDirectory, + bool enableHotReload, + Directory cwd, + LaunchMode launchMode, + ) async { final AppInstance app = AppInstance(_getNewAppId(), runner: runner, logToStdout: daemon.logToStdout); _apps.add(app); @@ -562,7 +567,7 @@ return _apps.firstWhere((AppInstance app) => app.id == id, orElse: () => null); } - void _sendAppEvent(AppInstance app, String name, [Map<String, dynamic> args]) { + void _sendAppEvent(AppInstance app, String name, [ Map<String, dynamic> args ]) { final Map<String, dynamic> eventArgs = <String, dynamic> { 'appId': app.id }; if (args != null) eventArgs.addAll(args); @@ -620,7 +625,7 @@ /// Return a list of the current devices, with each device represented as a map /// of properties (id, name, platform, ...). - Future<List<Map<String, dynamic>>> getDevices([Map<String, dynamic> args]) async { + Future<List<Map<String, dynamic>>> getDevices([ Map<String, dynamic> args ]) async { final List<Map<String, dynamic>> devicesInfo = <Map<String, dynamic>>[]; for (PollingDeviceDiscovery discoverer in _discoverers) { @@ -761,27 +766,27 @@ @override void printError( - String message, { - StackTrace stackTrace, - bool emphasis = false, - TerminalColor color, - int indent, - int hangingIndent, - bool wrap, - }) { + String message, { + StackTrace stackTrace, + bool emphasis = false, + TerminalColor color, + int indent, + int hangingIndent, + bool wrap, + }) { _messageController.add(LogMessage('error', message, stackTrace)); } @override void printStatus( - String message, { - bool emphasis = false, - TerminalColor color, - bool newline = true, - int indent, - int hangingIndent, - bool wrap, - }) { + String message, { + bool emphasis = false, + TerminalColor color, + bool newline = true, + int indent, + int hangingIndent, + bool wrap, + }) { _messageController.add(LogMessage('status', message)); } @@ -851,7 +856,7 @@ EmulatorManager emulators = EmulatorManager(); - Future<List<Map<String, dynamic>>> getEmulators([Map<String, dynamic> args]) async { + Future<List<Map<String, dynamic>>> getEmulators([ Map<String, dynamic> args ]) async { final List<Emulator> list = await emulators.getAllAvailableEmulators(); return list.map<Map<String, dynamic>>(_emulatorToMap).toList(); } @@ -898,14 +903,14 @@ @override void printError( - String message, { - StackTrace stackTrace, - bool emphasis, - TerminalColor color, - int indent, - int hangingIndent, - bool wrap, - }) { + String message, { + StackTrace stackTrace, + bool emphasis, + TerminalColor color, + int indent, + int hangingIndent, + bool wrap, + }) { if (parent != null) { parent.printError( message, @@ -933,14 +938,14 @@ @override void printStatus( - String message, { - bool emphasis = false, - TerminalColor color, - bool newline = true, - int indent, - int hangingIndent, - bool wrap, - }) { + String message, { + bool emphasis = false, + TerminalColor color, + bool newline = true, + int indent, + int hangingIndent, + bool wrap, + }) { if (parent != null) { parent.printStatus( message,
diff --git a/packages/flutter_tools/lib/src/commands/emulators.dart b/packages/flutter_tools/lib/src/commands/emulators.dart index 4821519..471a26d 100644 --- a/packages/flutter_tools/lib/src/commands/emulators.dart +++ b/packages/flutter_tools/lib/src/commands/emulators.dart
@@ -83,7 +83,7 @@ } } - Future<void> _createEmulator({String name}) async { + Future<void> _createEmulator({ String name }) async { final CreateEmulatorResult createResult = await emulatorManager.createEmulator(name: name); @@ -118,8 +118,10 @@ _printAdditionalInfo(showCreateInstruction: true, showRunInstruction: true); } - void _printAdditionalInfo({ bool showRunInstruction = false, - bool showCreateInstruction = false }) { + void _printAdditionalInfo({ + bool showRunInstruction = false, + bool showCreateInstruction = false, + }) { printStatus(''); if (showRunInstruction) { printStatus(
diff --git a/packages/flutter_tools/lib/src/commands/ide_config.dart b/packages/flutter_tools/lib/src/commands/ide_config.dart index f153b3b..e977779 100644 --- a/packages/flutter_tools/lib/src/commands/ide_config.dart +++ b/packages/flutter_tools/lib/src/commands/ide_config.dart
@@ -266,7 +266,7 @@ /// Return null if the flutter root directory is a valid destination. Return a /// validation message if we should disallow the directory. -String _validateFlutterDir(String dirPath, {String flutterRoot}) { +String _validateFlutterDir(String dirPath, { String flutterRoot }) { final FileSystemEntityType type = fs.typeSync(dirPath); if (type != FileSystemEntityType.notFound) {
diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index 5f7c5d8..cfd678a 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart
@@ -1187,7 +1187,8 @@ /// The transitive closure of all the dependencies for the given package, /// excluding any listen in `seen`. - Iterable<String> getTransitiveDependenciesFor(String package, { + Iterable<String> getTransitiveDependenciesFor( + String package, { @required Set<String> seen, @required Set<String> exclude, }) sync* {
diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 8fa4ed7..4b69371 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart
@@ -22,7 +22,7 @@ KernelCompiler get kernelCompiler => context[KernelCompiler]; -typedef CompilerMessageConsumer = void Function(String message, {bool emphasis, TerminalColor color}); +typedef CompilerMessageConsumer = void Function(String message, { bool emphasis, TerminalColor color }); /// The target model describes the set of core libraries that are availible within /// the SDK. @@ -101,7 +101,7 @@ // This is needed to get ready to process next compilation result output, // with its own boundary key and new completer. - void reset({bool suppressCompilerMessages = false}) { + void reset({ bool suppressCompilerMessages = false }) { boundaryKey = null; compilerMessageReceived = false; compilerOutput = Completer<CompilerOutput>(); @@ -397,8 +397,12 @@ /// point that is used for recompilation. /// Binary file name is returned if compilation was successful, otherwise /// null is returned. - Future<CompilerOutput> recompile(String mainPath, List<String> invalidatedFiles, - {@required String outputPath, String packagesFilePath}) async { + Future<CompilerOutput> recompile( + String mainPath, + List<String> invalidatedFiles, { + @required String outputPath, + String packagesFilePath, + }) async { assert (outputPath != null); if (!_controller.hasListener) { _controller.stream.listen(_handleCompilationRequest); @@ -466,8 +470,11 @@ } } - Future<CompilerOutput> _compile(String scriptUri, String outputPath, - String packagesFilePath) async { + Future<CompilerOutput> _compile( + String scriptUri, + String outputPath, + String packagesFilePath, + ) async { final String frontendServer = artifacts.getArtifactPath( Artifact.frontendServerSnapshotForEngineDartSdk ); @@ -535,8 +542,14 @@ return _stdoutHandler.compilerOutput.future; } - Future<CompilerOutput> compileExpression(String expression, List<String> definitions, - List<String> typeDefinitions, String libraryUri, String klass, bool isStatic) { + Future<CompilerOutput> compileExpression( + String expression, + List<String> definitions, + List<String> typeDefinitions, + String libraryUri, + String klass, + bool isStatic, + ) { if (!_controller.hasListener) { _controller.stream.listen(_handleCompilationRequest); } @@ -549,8 +562,7 @@ return completer.future; } - Future<CompilerOutput> _compileExpression( - _CompileExpressionRequest request) async { + Future<CompilerOutput> _compileExpression(_CompileExpressionRequest request) async { _stdoutHandler.reset(suppressCompilerMessages: true); // 'compile-expression' should be invoked after compiler has been started,
diff --git a/packages/flutter_tools/lib/src/convert.dart b/packages/flutter_tools/lib/src/convert.dart index 83c8d7d..2aedb81 100644 --- a/packages/flutter_tools/lib/src/convert.dart +++ b/packages/flutter_tools/lib/src/convert.dart
@@ -33,7 +33,7 @@ final bool reportErrors; @override - String convert(List<int> codeUnits, [int start = 0, int end]) { + String convert(List<int> codeUnits, [ int start = 0, int end ]) { final String result = super.convert(codeUnits, start, end); // Finding a unicode replacement character indicates that the input // was malformed.
diff --git a/packages/flutter_tools/lib/src/dart/pub.dart b/packages/flutter_tools/lib/src/dart/pub.dart index ce61edac..4de54f8 100644 --- a/packages/flutter_tools/lib/src/dart/pub.dart +++ b/packages/flutter_tools/lib/src/dart/pub.dart
@@ -135,7 +135,8 @@ /// /// [context] provides extra information to package server requests to /// understand usage. -Future<void> pub(List<String> arguments, { +Future<void> pub( + List<String> arguments, { @required PubContext context, String directory, MessageFilter filter, @@ -173,7 +174,8 @@ /// Runs pub in 'interactive' mode, directly piping the stdin stream of this /// process to that of pub, and the stdout/stderr stream of pub to the corresponding /// streams of this process. -Future<void> pubInteractively(List<String> arguments, { +Future<void> pubInteractively( + List<String> arguments, { String directory, }) async { Cache.releaseLockEarly();
diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 95fc213..66b473a 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart
@@ -634,11 +634,12 @@ return false; } - bool _shouldSkip(FileSystemEntity file, - String relativePath, - Uri directoryUriOnDevice, { - bool ignoreDotFiles = true, - }) { + bool _shouldSkip( + FileSystemEntity file, + String relativePath, + Uri directoryUriOnDevice, { + bool ignoreDotFiles = true, + }) { if (file is Directory) { // Skip non-files. return true; @@ -653,8 +654,7 @@ return false; } - Uri _directoryUriOnDevice(Uri directoryUriOnDevice, - Directory directory) { + Uri _directoryUriOnDevice(Uri directoryUriOnDevice, Directory directory) { if (directoryUriOnDevice == null) { final String relativeRootPath = fs.path.relative(directory.path, from: rootDirectory.path); if (relativeRootPath == '.') { @@ -668,10 +668,12 @@ /// Scan all files from the [fileFilter] that are contained in [directory] and /// pass various filters (e.g. ignoreDotFiles). - Future<bool> _scanFilteredDirectory(Set<String> fileFilter, - Directory directory, - {Uri directoryUriOnDevice, - bool ignoreDotFiles = true}) async { + Future<bool> _scanFilteredDirectory( + Set<String> fileFilter, + Directory directory, { + Uri directoryUriOnDevice, + bool ignoreDotFiles = true, + }) async { directoryUriOnDevice = _directoryUriOnDevice(directoryUriOnDevice, directory); try { @@ -700,11 +702,13 @@ } /// Scan all files in [directory] that pass various filters (e.g. ignoreDotFiles). - Future<bool> _scanDirectory(Directory directory, - {Uri directoryUriOnDevice, - bool recursive = false, - bool ignoreDotFiles = true, - Set<String> fileFilter}) async { + Future<bool> _scanDirectory( + Directory directory, { + Uri directoryUriOnDevice, + bool recursive = false, + bool ignoreDotFiles = true, + Set<String> fileFilter, + }) async { directoryUriOnDevice = _directoryUriOnDevice(directoryUriOnDevice, directory); if ((fileFilter != null) && fileFilter.isNotEmpty) { // When the fileFilter isn't empty, we can skip crawling the directory
diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index dc2a844..65c46ca 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart
@@ -247,7 +247,7 @@ /// Get a log reader for this device. /// If [app] is specified, this will return a log reader specific to that /// application. Otherwise, a global log reader will be returned. - DeviceLogReader getLogReader({ApplicationPackage app}); + DeviceLogReader getLogReader({ ApplicationPackage app }); /// Get the port forwarder for this device. DevicePortForwarder get portForwarder; @@ -425,7 +425,7 @@ /// Forward [hostPort] on the host to [devicePort] on the device. /// If [hostPort] is null or zero, will auto select a host port. /// Returns a Future that completes with the host port. - Future<int> forward(int devicePort, {int hostPort}); + Future<int> forward(int devicePort, { int hostPort }); /// Stops forwarding [forwardedPort]. Future<void> unforward(ForwardedPort forwardedPort); @@ -471,7 +471,7 @@ const NoOpDevicePortForwarder(); @override - Future<int> forward(int devicePort, {int hostPort}) async => devicePort; + Future<int> forward(int devicePort, { int hostPort }) async => devicePort; @override List<ForwardedPort> get forwardedPorts => <ForwardedPort>[];
diff --git a/packages/flutter_tools/lib/src/emulator.dart b/packages/flutter_tools/lib/src/emulator.dart index 51d0706..3672d44 100644 --- a/packages/flutter_tools/lib/src/emulator.dart +++ b/packages/flutter_tools/lib/src/emulator.dart
@@ -61,7 +61,7 @@ } /// Return the list of all available emulators. - Future<CreateEmulatorResult> createEmulator({String name}) async { + Future<CreateEmulatorResult> createEmulator({ String name }) async { if (name == null || name == '') { const String autoName = 'flutter_emulator'; // Don't use getEmulatorsMatching here, as it will only return one
diff --git a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart index e874d6b..bb27e0c 100644 --- a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart +++ b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
@@ -92,7 +92,7 @@ } @override - void addError(Object error, [StackTrace stackTrace]) { + void addError(Object error, [ StackTrace stackTrace ]) { _outputSink.addError(error, stackTrace); } @@ -205,7 +205,7 @@ Future<String> get sdkNameAndVersion async => 'Fuchsia'; @override - DeviceLogReader getLogReader({ApplicationPackage app}) => _logReader ??= _FuchsiaLogReader(this, app); + DeviceLogReader getLogReader({ ApplicationPackage app }) => _logReader ??= _FuchsiaLogReader(this, app); _FuchsiaLogReader _logReader; @override @@ -397,7 +397,7 @@ final Map<int, Process> _processes = <int, Process>{}; @override - Future<int> forward(int devicePort, {int hostPort}) async { + Future<int> forward(int devicePort, { int hostPort }) async { hostPort ??= await _findPort(); // Note: the provided command works around a bug in -N, see US-515 // for more explanation.
diff --git a/packages/flutter_tools/lib/src/intellij/intellij.dart b/packages/flutter_tools/lib/src/intellij/intellij.dart index 7bed197..4976613 100644 --- a/packages/flutter_tools/lib/src/intellij/intellij.dart +++ b/packages/flutter_tools/lib/src/intellij/intellij.dart
@@ -17,8 +17,11 @@ static final Version kMinFlutterPluginVersion = Version(16, 0, 0); void validatePackage( - List<ValidationMessage> messages, List<String> packageNames, String title, - {Version minVersion}) { + List<ValidationMessage> messages, + List<String> packageNames, + String title, { + Version minVersion, + }) { for (String packageName in packageNames) { if (!_hasPackage(packageName)) { continue;
diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index 43efdf3..c4e092e 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart
@@ -374,7 +374,7 @@ Future<String> get sdkNameAndVersion async => 'iOS $_sdkVersion'; @override - DeviceLogReader getLogReader({ApplicationPackage app}) { + DeviceLogReader getLogReader({ ApplicationPackage app }) { _logReaders ??= <ApplicationPackage, _IOSDeviceLogReader>{}; return _logReaders.putIfAbsent(app, () => _IOSDeviceLogReader(this, app)); } @@ -551,7 +551,7 @@ static const Duration _kiProxyPortForwardTimeout = Duration(seconds: 1); @override - Future<int> forward(int devicePort, {int hostPort}) async { + Future<int> forward(int devicePort, { int hostPort }) async { final bool autoselect = hostPort == null || hostPort == 0; if (autoselect) hostPort = 1024;
diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index 90c2d67..525a1da 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart
@@ -139,7 +139,7 @@ return result; } - Future<RunResult> launch(String deviceId, String appIdentifier, [List<String> launchArgs]) { + Future<RunResult> launch(String deviceId, String appIdentifier, [ List<String> launchArgs ]) { final List<String> args = <String>[_xcrunPath, 'simctl', 'launch', deviceId, appIdentifier]; if (launchArgs != null) args.addAll(launchArgs); @@ -434,7 +434,7 @@ } @override - DeviceLogReader getLogReader({ApplicationPackage app}) { + DeviceLogReader getLogReader({ ApplicationPackage app }) { assert(app is IOSApp); _logReaders ??= <ApplicationPackage, _IOSSimulatorLogReader>{}; return _logReaders.putIfAbsent(app, () => _IOSSimulatorLogReader(this, app)); @@ -700,7 +700,7 @@ } @override - Future<int> forward(int devicePort, {int hostPort}) async { + Future<int> forward(int devicePort, { int hostPort }) async { if (hostPort == null || hostPort == 0) { hostPort = devicePort; }
diff --git a/packages/flutter_tools/lib/src/linux/linux_device.dart b/packages/flutter_tools/lib/src/linux/linux_device.dart index 18637d1..c9c991a 100644 --- a/packages/flutter_tools/lib/src/linux/linux_device.dart +++ b/packages/flutter_tools/lib/src/linux/linux_device.dart
@@ -17,7 +17,7 @@ void clearLogs() {} @override - DeviceLogReader getLogReader({ApplicationPackage app}) => NoOpDeviceLogReader('linux'); + DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('linux'); @override Future<bool> installApp(ApplicationPackage app) { @@ -50,7 +50,8 @@ Future<String> get sdkNameAndVersion async => os.name; @override - Future<LaunchResult> startApp(ApplicationPackage package, { + Future<LaunchResult> startApp( + ApplicationPackage package, { String mainPath, String route, DebuggingOptions debuggingOptions,
diff --git a/packages/flutter_tools/lib/src/macos/macos_device.dart b/packages/flutter_tools/lib/src/macos/macos_device.dart index 7ba605b..ac4c7bf 100644 --- a/packages/flutter_tools/lib/src/macos/macos_device.dart +++ b/packages/flutter_tools/lib/src/macos/macos_device.dart
@@ -23,7 +23,7 @@ void clearLogs() {} @override - DeviceLogReader getLogReader({ApplicationPackage app}) => NoOpDeviceLogReader('macos'); + DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('macos'); // Since the host and target devices are the same, no work needs to be done // to install the application. @@ -56,7 +56,8 @@ Future<String> get sdkNameAndVersion async => os.name; @override - Future<LaunchResult> startApp(covariant MacOSApp package, { + Future<LaunchResult> startApp( + covariant MacOSApp package, { String mainPath, String route, DebuggingOptions debuggingOptions,
diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 576240d..8db4102 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart
@@ -141,7 +141,8 @@ await Future.wait(futures).timeout(const Duration(seconds: 2), onTimeout: () { }); } - Future<Uri> setupDevFS(String fsName, + Future<Uri> setupDevFS( + String fsName, Directory rootDirectory, { String packagesFilePath }) { @@ -472,7 +473,7 @@ String get projectRootPath => _projectRootPath; String _mainPath; String get mainPath => _mainPath; - String getReloadPath({bool fullRestart}) => mainPath + (fullRestart ? '' : '.incremental') + '.dill'; + String getReloadPath({ bool fullRestart }) => mainPath + (fullRestart ? '' : '.incremental') + '.dill'; AssetBundle _assetBundle; AssetBundle get assetBundle => _assetBundle; @@ -980,7 +981,7 @@ /// Given the value of the --target option, return the path of the Dart file /// where the app's main function should be. -String findMainDartFile([String target]) { +String findMainDartFile([ String target ]) { target ??= ''; final String targetPath = fs.path.absolute(target); if (fs.isDirectorySync(targetPath))
diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index 116768a..cae7e4f 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart
@@ -141,8 +141,11 @@ return true; } - Future<void> _reloadSourcesService(String isolateId, - { bool force = false, bool pause = false }) async { + Future<void> _reloadSourcesService( + String isolateId, { + bool force = false, + bool pause = false, + }) async { // TODO(cbernaschina): check that isolateId is the id of the UI isolate. final OperationResult result = await restart(pauseAfterRestart: pause); if (!result.isOk) { @@ -164,10 +167,15 @@ } } - Future<String> _compileExpressionService(String isolateId, String expression, - List<String> definitions, List<String> typeDefinitions, - String libraryUri, String klass, bool isStatic, - ) async { + Future<String> _compileExpressionService( + String isolateId, + String expression, + List<String> definitions, + List<String> typeDefinitions, + String libraryUri, + String klass, + bool isStatic, + ) async { for (FlutterDevice device in flutterDevices) { if (device.generator != null) { final CompilerOutput compilerOutput = @@ -433,10 +441,12 @@ await Future.wait(futures); } - Future<void> _launchInView(FlutterDevice device, - Uri entryUri, - Uri packagesUri, - Uri assetsDirectoryUri) { + Future<void> _launchInView( + FlutterDevice device, + Uri entryUri, + Uri packagesUri, + Uri assetsDirectoryUri, + ) { final List<Future<void>> futures = <Future<void>>[]; for (FlutterView view in device.views) futures.add(view.runFromSource(entryUri, packagesUri, assetsDirectoryUri)); @@ -538,8 +548,10 @@ /// Returns [true] if the reload was successful. /// Prints errors if [printErrors] is [true]. - static bool validateReloadReport(Map<String, dynamic> reloadReport, - { bool printErrors = true }) { + static bool validateReloadReport( + Map<String, dynamic> reloadReport, { + bool printErrors = true, + }) { if (reloadReport == null) { if (printErrors) printError('Hot reload did not receive reload report.');
diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart index f3c903d..fc93ba6 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart
@@ -139,7 +139,7 @@ /// /// [hide] indicates whether or not to hide these options when the user asks /// for help. - void usesFilesystemOptions({@required bool hide}) { + void usesFilesystemOptions({ @required bool hide }) { argParser ..addOption('output-dill', hide: hide, @@ -216,7 +216,7 @@ valueHelp: 'x.y.z'); } - void usesIsolateFilterOption({@required bool hide}) { + void usesIsolateFilterOption({ @required bool hide }) { argParser.addOption('isolate-filter', defaultsTo: null, hide: hide, @@ -224,7 +224,7 @@ 'Normally there\'s only one, but when adding Flutter to a pre-existing app it\'s possible to create multiple.'); } - void addBuildModeFlags({bool defaultToRelease = true, bool verboseHelp = false}) { + void addBuildModeFlags({ bool defaultToRelease = true, bool verboseHelp = false }) { defaultBuildMode = defaultToRelease ? BuildMode.release : BuildMode.debug; argParser.addFlag('debug', @@ -242,7 +242,7 @@ help: 'Enable dynamic code. Only allowed with --release or --profile.'); } - void addDynamicModeFlags({bool verboseHelp = false}) { + void addDynamicModeFlags({ bool verboseHelp = false }) { argParser.addOption('compilation-trace-file', defaultsTo: 'compilation.txt', hide: !verboseHelp, @@ -260,7 +260,7 @@ ); } - void addDynamicPatchingFlags({bool verboseHelp = false}) { + void addDynamicPatchingFlags({ bool verboseHelp = false }) { argParser.addOption('patch-number', hide: !verboseHelp, help: 'An integer used as an internal version number for dynamic patch.\n' @@ -291,7 +291,7 @@ addDynamicBaselineFlags(verboseHelp: verboseHelp); } - void addDynamicBaselineFlags({bool verboseHelp = false}) { + void addDynamicBaselineFlags({ bool verboseHelp = false }) { argParser.addOption('baseline-dir', defaultsTo: '.baseline', hide: !verboseHelp, @@ -301,7 +301,7 @@ ); } - void usesFuchsiaOptions({bool hide = false}) { + void usesFuchsiaOptions({ bool hide = false }) { argParser.addOption( 'target-model', help: 'Target model that determines what core libraries are available',
diff --git a/packages/flutter_tools/lib/src/services.dart b/packages/flutter_tools/lib/src/services.dart index fee5383..2eb5560 100644 --- a/packages/flutter_tools/lib/src/services.dart +++ b/packages/flutter_tools/lib/src/services.dart
@@ -26,8 +26,9 @@ /// Loads all services specified in `pubspec.yaml`. Parses each service config file, /// storing meta data in [services] and the list of jar files in [jars]. Future<void> parseServiceConfigs( - List<Map<String, String>> services, { List<File> jars } -) async { + List<Map<String, String>> services, { + List<File> jars, +}) async { Map<String, Uri> packageMap; try { packageMap = PackageMap(PackageMap.globalPackagesPath).map; @@ -95,7 +96,8 @@ /// ] /// } File generateServiceDefinitions( - String dir, List<Map<String, String>> servicesIn + String dir, + List<Map<String, String>> servicesIn, ) { final List<Map<String, String>> services = servicesIn.map<Map<String, String>>((Map<String, String> service) => <String, String>{
diff --git a/packages/flutter_tools/lib/src/test/event_printer.dart b/packages/flutter_tools/lib/src/test/event_printer.dart index e672f20..81fd5798 100644 --- a/packages/flutter_tools/lib/src/test/event_printer.dart +++ b/packages/flutter_tools/lib/src/test/event_printer.dart
@@ -18,7 +18,7 @@ <String, dynamic>{'observatoryUri': event.observatoryUri.toString()}); } - void _sendEvent(String name, [dynamic params]) { + void _sendEvent(String name, [ dynamic params ]) { final Map<String, dynamic> map = <String, dynamic>{ 'event': name}; if (params != null) { map['params'] = params;
diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index f93900f..451cf1a 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart
@@ -463,10 +463,15 @@ return remoteChannel; } - Future<String> _compileExpressionService(String isolateId, String expression, - List<String> definitions, List<String> typeDefinitions, - String libraryUri, String klass, bool isStatic, - ) async { + Future<String> _compileExpressionService( + String isolateId, + String expression, + List<String> definitions, + List<String> typeDefinitions, + String libraryUri, + String klass, + bool isStatic, + ) async { if (compiler == null || compiler.compiler == null) { throw 'Compiler is not set up properly to compile $expression'; } @@ -807,8 +812,12 @@ return outOfBandError; } - String _createListenerDart(List<_Finalizer> finalizers, int ourTestCount, - String testPath, HttpServer server) { + String _createListenerDart( + List<_Finalizer> finalizers, + int ourTestCount, + String testPath, + HttpServer server, + ) { // Prepare a temporary directory to store the Dart file that will talk to us. final Directory tempDir = fs.systemTempDirectory.createTempSync('flutter_test_listener.'); finalizers.add(() async { @@ -1061,7 +1070,7 @@ @override void add(S event) => _parent.add(event); @override - void addError(dynamic errorEvent, [StackTrace stackTrace]) => _parent.addError(errorEvent, stackTrace); + void addError(dynamic errorEvent, [ StackTrace stackTrace ]) => _parent.addError(errorEvent, stackTrace); @override Future<dynamic> addStream(Stream<S> stream) => _parent.addStream(stream); }
diff --git a/packages/flutter_tools/lib/src/tester/flutter_tester.dart b/packages/flutter_tools/lib/src/tester/flutter_tester.dart index ea52c54..463d84c 100644 --- a/packages/flutter_tools/lib/src/tester/flutter_tester.dart +++ b/packages/flutter_tools/lib/src/tester/flutter_tester.dart
@@ -71,7 +71,7 @@ _FlutterTesterDeviceLogReader(); @override - DeviceLogReader getLogReader({ApplicationPackage app}) => _logReader; + DeviceLogReader getLogReader({ ApplicationPackage app }) => _logReader; @override Future<bool> installApp(ApplicationPackage app) async => true; @@ -235,7 +235,7 @@ /// where the VM is running on the same machine and does not need ports forwarding. class _NoopPortForwarder extends DevicePortForwarder { @override - Future<int> forward(int devicePort, {int hostPort}) { + Future<int> forward(int devicePort, { int hostPort }) { if (hostPort != null && hostPort != devicePort) throw 'Forwarding to a different port is not supported by flutter tester'; return Future<int>.value(devicePort);
diff --git a/packages/flutter_tools/lib/src/usage.dart b/packages/flutter_tools/lib/src/usage.dart index 72d5857..3cd6c63 100644 --- a/packages/flutter_tools/lib/src/usage.dart +++ b/packages/flutter_tools/lib/src/usage.dart
@@ -91,8 +91,11 @@ _analytics.sendScreenView(command, parameters: parameters); } - void sendEvent(String category, String parameter, - { Map<String, String> parameters }) { + void sendEvent( + String category, + String parameter, { + Map<String, String> parameters, + }) { if (suppressAnalytics) return; @@ -106,7 +109,7 @@ String variableName, Duration duration, { String label, - }) { + }) { if (!suppressAnalytics) { _analytics.sendTiming( variableName,
diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index bd65cc3..e196816 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart
@@ -120,7 +120,7 @@ /// A date String describing the last framework commit. String get frameworkCommitDate => _latestGitCommitDate(); - static String _latestGitCommitDate([String branch]) { + static String _latestGitCommitDate([ String branch ]) { final List<String> args = <String>['git', 'log']; if (branch != null) @@ -171,7 +171,7 @@ static FlutterVersion get instance => context[FlutterVersion]; /// Return a short string for the version (e.g. `master/0.0.59-pre.92`, `scroll_refactor/a76bc8e22b`). - String getVersionString({bool redactUnknownBranches = false}) { + String getVersionString({ bool redactUnknownBranches = false }) { if (frameworkVersion != 'unknown') return '${getBranchName(redactUnknownBranches: redactUnknownBranches)}/$frameworkVersion'; return '${getBranchName(redactUnknownBranches: redactUnknownBranches)}/$frameworkRevisionShort'; @@ -496,7 +496,7 @@ /// /// If [lenient] is true and the command fails, returns an empty string. /// Otherwise, throws a [ToolExit] exception. -String _runSync(List<String> command, {bool lenient = true}) { +String _runSync(List<String> command, { bool lenient = true }) { final ProcessResult results = processManager.runSync(command, workingDirectory: Cache.flutterRoot); if (results.exitCode == 0)
diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index 2585c50..545443e 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart
@@ -379,8 +379,10 @@ /// recursively walk the response and replace values that are service maps with /// actual [ServiceObject]s. During the upgrade the owner is given a chance /// to return a cached / canonicalized object. -void _upgradeCollection(dynamic collection, - ServiceObjectOwner owner) { +void _upgradeCollection( + dynamic collection, + ServiceObjectOwner owner, +) { if (collection is ServiceMap) return; if (collection is Map<String, dynamic>) { @@ -827,7 +829,8 @@ } /// Invoke the RPC and return the raw response. - Future<Map<String, dynamic>> invokeRpcRaw(String method, { + Future<Map<String, dynamic>> invokeRpcRaw( + String method, { Map<String, dynamic> params = const <String, dynamic>{}, }) async { printTrace('Sending to VM service: $method($params)'); @@ -847,7 +850,8 @@ } /// Invoke the RPC and return a [ServiceObject] response. - Future<T> invokeRpc<T extends ServiceObject>(String method, { + Future<T> invokeRpc<T extends ServiceObject>( + String method, { Map<String, dynamic> params = const <String, dynamic>{}, }) async { final Map<String, dynamic> response = await invokeRpcRaw( @@ -873,7 +877,8 @@ } // Write one file into a file system. - Future<Map<String, dynamic>> writeDevFSFile(String fsName, { + Future<Map<String, dynamic>> writeDevFSFile( + String fsName, { @required String path, @required List<int> fileContents }) { @@ -911,10 +916,12 @@ return invokeRpcRaw('_deleteDevFS', params: <String, dynamic>{ 'fsName': fsName }); } - Future<ServiceMap> runInView(String viewId, - Uri main, - Uri packages, - Uri assetsDirectory) { + Future<ServiceMap> runInView( + String viewId, + Uri main, + Uri packages, + Uri assetsDirectory, + ) { return invokeRpc<ServiceMap>('_flutter.runInView', params: <String, dynamic> { 'viewId': viewId, @@ -1090,7 +1097,8 @@ Future<Map<String, dynamic>> _fetchDirect() => invokeRpcRaw('getIsolate'); /// Invoke the RPC and return the raw response. - Future<Map<String, dynamic>> invokeRpcRaw(String method, { + Future<Map<String, dynamic>> invokeRpcRaw( + String method, { Map<String, dynamic> params, }) { // Inject the 'isolateId' parameter. @@ -1134,10 +1142,11 @@ static const int kIsolateReloadBarred = 1005; - Future<Map<String, dynamic>> reloadSources( - { bool pause = false, - Uri rootLibUri, - Uri packagesUri}) async { + Future<Map<String, dynamic>> reloadSources({ + bool pause = false, + Uri rootLibUri, + Uri packagesUri, + }) async { try { final Map<String, dynamic> arguments = <String, dynamic>{ 'pause': pause @@ -1222,9 +1231,8 @@ // available, returns null. Future<Map<String, dynamic>> invokeFlutterExtensionRpcRaw( String method, { - Map<String, dynamic> params, - } - ) async { + Map<String, dynamic> params, + }) async { try { return await invokeRpcRaw(method, params: params); } on rpc.RpcException catch (e) { @@ -1314,7 +1322,7 @@ return invokeFlutterExtensionRpcRaw('ext.flutter.exit'); } - Future<String> flutterPlatformOverride([String platform]) async { + Future<String> flutterPlatformOverride([ String platform ]) async { final Map<String, dynamic> result = await invokeFlutterExtensionRpcRaw( 'ext.flutter.platformOverride', params: platform != null ? <String, dynamic>{ 'value': platform } : <String, String>{}, @@ -1386,7 +1394,7 @@ void updateAll(dynamic update(String key, dynamic value)) => _map.updateAll(update); Map<RK, RV> retype<RK, RV>() => _map.cast<RK, RV>(); @override - dynamic update(String key, dynamic update(dynamic value), {dynamic ifAbsent()}) => _map.update(key, update, ifAbsent: ifAbsent); + dynamic update(String key, dynamic update(dynamic value), { dynamic ifAbsent() }) => _map.update(key, update, ifAbsent: ifAbsent); } /// Peered to an Android/iOS FlutterView widget on a device. @@ -1404,9 +1412,11 @@ } // TODO(johnmccutchan): Report errors when running failed. - Future<void> runFromSource(Uri entryUri, - Uri packagesUri, - Uri assetsDirectoryUri) async { + Future<void> runFromSource( + Uri entryUri, + Uri packagesUri, + Uri assetsDirectoryUri, + ) async { final String viewId = id; // When this completer completes the isolate is running. final Completer<void> completer = Completer<void>();
diff --git a/packages/flutter_tools/lib/src/vmservice_record_replay.dart b/packages/flutter_tools/lib/src/vmservice_record_replay.dart index 0868682..9da5bf4 100644 --- a/packages/flutter_tools/lib/src/vmservice_record_replay.dart +++ b/packages/flutter_tools/lib/src/vmservice_record_replay.dart
@@ -180,7 +180,7 @@ } @override - void addError(dynamic errorEvent, [StackTrace stackTrace]) { + void addError(dynamic errorEvent, [ StackTrace stackTrace ]) { throw UnimplementedError('Add support for this if the need ever arises'); } @@ -272,7 +272,7 @@ } @override - void addError(dynamic errorEvent, [StackTrace stackTrace]) { + void addError(dynamic errorEvent, [ StackTrace stackTrace ]) { throw UnimplementedError('Add support for this if the need ever arises'); }
diff --git a/packages/flutter_tools/lib/src/vscode/vscode.dart b/packages/flutter_tools/lib/src/vscode/vscode.dart index c9503fd..94c9a04 100644 --- a/packages/flutter_tools/lib/src/vscode/vscode.dart +++ b/packages/flutter_tools/lib/src/vscode/vscode.dart
@@ -189,8 +189,7 @@ ]); } - static List<VsCode> _findInstalled( - List<_VsCodeInstallLocation> allLocations) { + static List<VsCode> _findInstalled(List<_VsCodeInstallLocation> allLocations) { final Iterable<_VsCodeInstallLocation> searchLocations = _includeInsiders ? allLocations
diff --git a/packages/flutter_tools/lib/src/windows/windows_device.dart b/packages/flutter_tools/lib/src/windows/windows_device.dart index 954efec..005e100 100644 --- a/packages/flutter_tools/lib/src/windows/windows_device.dart +++ b/packages/flutter_tools/lib/src/windows/windows_device.dart
@@ -17,7 +17,7 @@ void clearLogs() {} @override - DeviceLogReader getLogReader({ApplicationPackage app}) => NoOpDeviceLogReader('windows'); + DeviceLogReader getLogReader({ ApplicationPackage app }) => NoOpDeviceLogReader('windows'); @override Future<bool> installApp(ApplicationPackage app) { @@ -50,7 +50,8 @@ Future<String> get sdkNameAndVersion async => os.name; @override - Future<LaunchResult> startApp(ApplicationPackage package, { + Future<LaunchResult> startApp( + ApplicationPackage package, { String mainPath, String route, DebuggingOptions debuggingOptions,