format parameter list (#27261)
diff --git a/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart b/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart index a30b8cb..648a092 100644 --- a/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart +++ b/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart
@@ -26,7 +26,7 @@ // rolls into Flutter. return path?.replaceAll('/', fs.path.separator); } - void writePubspecFile(String path, String name, {String fontsSection}) { + void writePubspecFile(String path, String name, { String fontsSection }) { if (fontsSection == null) { fontsSection = ''; } else {
diff --git a/packages/flutter_tools/test/asset_bundle_package_test.dart b/packages/flutter_tools/test/asset_bundle_package_test.dart index 9ed6f03..2ea7946 100644 --- a/packages/flutter_tools/test/asset_bundle_package_test.dart +++ b/packages/flutter_tools/test/asset_bundle_package_test.dart
@@ -26,7 +26,7 @@ // rolls into Flutter. return path?.replaceAll('/', fs.path.separator); } - void writePubspecFile(String path, String name, {List<String> assets}) { + void writePubspecFile(String path, String name, { List<String> assets }) { String assetsSection; if (assets == null) { assetsSection = '';
diff --git a/packages/flutter_tools/test/base/net_test.dart b/packages/flutter_tools/test/base/net_test.dart index c99182c..dd867ed 100644 --- a/packages/flutter_tools/test/base/net_test.dart +++ b/packages/flutter_tools/test/base/net_test.dart
@@ -192,8 +192,11 @@ String get reasonPhrase => '<reason phrase>'; @override - StreamSubscription<List<int>> listen(void onData(List<int> event), { - Function onError, void onDone(), bool cancelOnError + StreamSubscription<List<int>> listen( + void onData(List<int> event), { + Function onError, + void onDone(), + bool cancelOnError, }) { return Stream<List<int>>.fromFuture(Future<List<int>>.error(const io.SocketException('test'))) .listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
diff --git a/packages/flutter_tools/test/base/process_test.dart b/packages/flutter_tools/test/base/process_test.dart index f897690..2139a54 100644 --- a/packages/flutter_tools/test/base/process_test.dart +++ b/packages/flutter_tools/test/base/process_test.dart
@@ -69,7 +69,7 @@ mockLogger = BufferLogger(); }); - MockProcess Function(List<String>) processMetaFactory(List<String> stdout, {List<String> stderr = const <String>[]}) { + MockProcess Function(List<String>) processMetaFactory(List<String> stdout, { List<String> stderr = const <String>[] }) { final Stream<List<int>> stdoutStream = Stream<List<int>>.fromIterable(stdout.map<List<int>>((String s) => s.codeUnits)); final Stream<List<int>> stderrStream =
diff --git a/packages/flutter_tools/test/cache_test.dart b/packages/flutter_tools/test/cache_test.dart index 03912cb..41840a3 100644 --- a/packages/flutter_tools/test/cache_test.dart +++ b/packages/flutter_tools/test/cache_test.dart
@@ -154,7 +154,7 @@ class MockFile extends Mock implements File { @override - Future<RandomAccessFile> open({FileMode mode = FileMode.read}) async { + Future<RandomAccessFile> open({ FileMode mode = FileMode.read }) async { return MockRandomAccessFile(); } }
diff --git a/packages/flutter_tools/test/channel_test.dart b/packages/flutter_tools/test/channel_test.dart index 1e6ea10..6e985c9 100644 --- a/packages/flutter_tools/test/channel_test.dart +++ b/packages/flutter_tools/test/channel_test.dart
@@ -18,7 +18,7 @@ import 'src/common.dart'; import 'src/context.dart'; -Process createMockProcess({int exitCode = 0, String stdout = '', String stderr = ''}) { +Process createMockProcess({ int exitCode = 0, String stdout = '', String stderr = '' }) { final Stream<List<int>> stdoutStream = Stream<List<int>>.fromIterable(<List<int>>[ utf8.encode(stdout), ]);
diff --git a/packages/flutter_tools/test/commands/create_test.dart b/packages/flutter_tools/test/commands/create_test.dart index 70ad746..21fa293 100644 --- a/packages/flutter_tools/test/commands/create_test.dart +++ b/packages/flutter_tools/test/commands/create_test.dart
@@ -956,7 +956,7 @@ expect(exec.exitCode, 0); } -Future<void> _runFlutterTest(Directory workingDir, {String target}) async { +Future<void> _runFlutterTest(Directory workingDir, { String target }) async { final String flutterToolsPath = fs.path.absolute(fs.path.join( 'bin', 'flutter_tools.dart', @@ -1057,8 +1057,11 @@ String get reasonPhrase => '<reason phrase>'; @override - StreamSubscription<List<int>> listen(void onData(List<int> event), { - Function onError, void onDone(), bool cancelOnError + StreamSubscription<List<int>> listen( + void onData(List<int> event), { + Function onError, + void onDone(), + bool cancelOnError }) { return Stream<List<int>>.fromIterable(<List<int>>[result.codeUnits]) .listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
diff --git a/packages/flutter_tools/test/commands/devices_test.dart b/packages/flutter_tools/test/commands/devices_test.dart index f3fa126..a63f19b 100644 --- a/packages/flutter_tools/test/commands/devices_test.dart +++ b/packages/flutter_tools/test/commands/devices_test.dart
@@ -42,27 +42,27 @@ class MockProcessManager extends Mock implements ProcessManager { @override Future<ProcessResult> run( - List<dynamic> command, { - String workingDirectory, - Map<String, String> environment, - bool includeParentEnvironment = true, - bool runInShell = false, - Encoding stdoutEncoding = systemEncoding, - Encoding stderrEncoding = systemEncoding, - }) async { + List<dynamic> command, { + String workingDirectory, + Map<String, String> environment, + bool includeParentEnvironment = true, + bool runInShell = false, + Encoding stdoutEncoding = systemEncoding, + Encoding stderrEncoding = systemEncoding, + }) async { return ProcessResult(0, 0, '', ''); } @override ProcessResult runSync( - List<dynamic> command, { - String workingDirectory, - Map<String, String> environment, - bool includeParentEnvironment = true, - bool runInShell = false, - Encoding stdoutEncoding = systemEncoding, - Encoding stderrEncoding = systemEncoding, - }) { + List<dynamic> command, { + String workingDirectory, + Map<String, String> environment, + bool includeParentEnvironment = true, + bool runInShell = false, + Encoding stdoutEncoding = systemEncoding, + Encoding stderrEncoding = systemEncoding, + }) { return ProcessResult(0, 0, '', ''); } }
diff --git a/packages/flutter_tools/test/commands/drive_test.dart b/packages/flutter_tools/test/commands/drive_test.dart index bf61d20..81a435c 100644 --- a/packages/flutter_tools/test/commands/drive_test.dart +++ b/packages/flutter_tools/test/commands/drive_test.dart
@@ -26,7 +26,7 @@ MemoryFileSystem fs; Directory tempDir; - void withMockDevice([Device mock]) { + void withMockDevice([ Device mock ]) { mockDevice = mock ?? MockDevice(); targetDeviceFinder = () async => mockDevice; testDeviceManager.addDevice(mockDevice);
diff --git a/packages/flutter_tools/test/commands/ide_config_test.dart b/packages/flutter_tools/test/commands/ide_config_test.dart index f3959a1..4f4bf24 100644 --- a/packages/flutter_tools/test/commands/ide_config_test.dart +++ b/packages/flutter_tools/test/commands/ide_config_test.dart
@@ -20,7 +20,7 @@ Directory intellijDir; Directory toolsDir; - Map<String, String> _getFilesystemContents([Directory root]) { + Map<String, String> _getFilesystemContents([ Directory root ]) { final String tempPath = tempDir.absolute.path; final List<String> paths = (root ?? tempDir).listSync(recursive: true).map((FileSystemEntity entity) { @@ -39,7 +39,7 @@ return contents; } - Map<String, String> _getManifest(Directory base, String marker, {bool isTemplate = false}) { + Map<String, String> _getManifest(Directory base, String marker, { bool isTemplate = false }) { final String basePath = fs.path.relative(base.path, from: tempDir.absolute.path); final String suffix = isTemplate ? Template.copyTemplateExtension : ''; return <String, String>{
diff --git a/packages/flutter_tools/test/commands/packages_test.dart b/packages/flutter_tools/test/commands/packages_test.dart index 051bd39..d7a4718 100644 --- a/packages/flutter_tools/test/commands/packages_test.dart +++ b/packages/flutter_tools/test/commands/packages_test.dart
@@ -45,7 +45,7 @@ tryToDelete(tempDir); }); - Future<String> createProjectWithPlugin(String plugin, {List<String> arguments}) async { + Future<String> createProjectWithPlugin(String plugin, { List<String> arguments }) async { final String projectPath = await createProject(tempDir, arguments: arguments); final File pubspec = fs.file(fs.path.join(projectPath, 'pubspec.yaml')); String content = await pubspec.readAsString();
diff --git a/packages/flutter_tools/test/commands/test_test.dart b/packages/flutter_tools/test/commands/test_test.dart index 4c05295..cefe0bd 100644 --- a/packages/flutter_tools/test/commands/test_test.dart +++ b/packages/flutter_tools/test/commands/test_test.dart
@@ -90,7 +90,7 @@ }); } -Future<void> _testFile(String testName, String workingDirectory, String testDirectory, {Matcher exitCode}) async { +Future<void> _testFile(String testName, String workingDirectory, String testDirectory, { Matcher exitCode }) async { exitCode ??= isNonZero; final String fullTestExpectation = fs.path.join(testDirectory, '${testName}_expectation.txt'); final File expectationFile = fs.file(fullTestExpectation);
diff --git a/packages/flutter_tools/test/compile_test.dart b/packages/flutter_tools/test/compile_test.dart index ba7ae68..5bef8cc 100644 --- a/packages/flutter_tools/test/compile_test.dart +++ b/packages/flutter_tools/test/compile_test.dart
@@ -502,9 +502,12 @@ }); } -Future<void> _recompile(StreamController<List<int>> streamController, - ResidentCompiler generator, MockStdIn mockFrontendServerStdIn, - String mockCompilerOutput) async { +Future<void> _recompile( + StreamController<List<int>> streamController, + ResidentCompiler generator, + MockStdIn mockFrontendServerStdIn, + String mockCompilerOutput, +) async { // Put content into the output stream after generator.recompile gets // going few lines below, resets completer. scheduleMicrotask(() { @@ -565,12 +568,12 @@ } @override - void write([Object o = '']) { + void write([ Object o = '' ]) { _stdInWrites.write(o); } @override - void writeln([Object o = '']) { + void writeln([ Object o = '' ]) { _stdInWrites.writeln(o); } }
diff --git a/packages/flutter_tools/test/crash_reporting_test.dart b/packages/flutter_tools/test/crash_reporting_test.dart index f3255c6..cac269e 100644 --- a/packages/flutter_tools/test/crash_reporting_test.dart +++ b/packages/flutter_tools/test/crash_reporting_test.dart
@@ -216,16 +216,16 @@ void write(_) {} @override - void writeAll(_, [__ = '']) {} + void writeAll(_, [ __ = '' ]) {} @override - void writeln([_ = '']) {} + void writeln([ _ = '' ]) {} @override void writeCharCode(_) {} @override - void addError(_, [__]) {} + void addError(_, [ __ ]) {} @override Future<dynamic> addStream(_) async {}
diff --git a/packages/flutter_tools/test/dart/pub_get_test.dart b/packages/flutter_tools/test/dart/pub_get_test.dart index abd5d8b..f3552c2 100644 --- a/packages/flutter_tools/test/dart/pub_get_test.dart +++ b/packages/flutter_tools/test/dart/pub_get_test.dart
@@ -200,7 +200,7 @@ Stream<T> where(bool test(T event)) => MockStream<T>(); @override - StreamSubscription<T> listen(void onData(T event), {Function onError, void onDone(), bool cancelOnError}) { + StreamSubscription<T> listen(void onData(T event), { Function onError, void onDone(), bool cancelOnError }) { return MockStreamSubscription<T>(); } @@ -210,7 +210,7 @@ class MockStreamSubscription<T> implements StreamSubscription<T> { @override - Future<E> asFuture<E>([E futureValue]) => Future<E>.value(); + Future<E> asFuture<E>([ E futureValue ]) => Future<E>.value(); @override Future<void> cancel() async { } @@ -236,7 +236,7 @@ class MockFile implements File { @override - Future<RandomAccessFile> open({FileMode mode = FileMode.read}) async { + Future<RandomAccessFile> open({ FileMode mode = FileMode.read }) async { return MockRandomAccessFile(); }
diff --git a/packages/flutter_tools/test/devfs_test.dart b/packages/flutter_tools/test/devfs_test.dart index 5a96c7d..16ccf40 100644 --- a/packages/flutter_tools/test/devfs_test.dart +++ b/packages/flutter_tools/test/devfs_test.dart
@@ -604,7 +604,8 @@ } @override - Future<Map<String, dynamic>> invokeRpcRaw(String method, { + Future<Map<String, dynamic>> invokeRpcRaw( + String method, { Map<String, dynamic> params = const <String, dynamic>{}, Duration timeout, bool timeoutFatal = true,
diff --git a/packages/flutter_tools/test/flutter_manifest_test.dart b/packages/flutter_tools/test/flutter_manifest_test.dart index 424c9da..b4f4508 100644 --- a/packages/flutter_tools/test/flutter_manifest_test.dart +++ b/packages/flutter_tools/test/flutter_manifest_test.dart
@@ -494,8 +494,11 @@ expect(flutterManifest.isEmpty, false); } - void testUsingContextAndFs(String description, FileSystem filesystem, - dynamic testMethod()) { + void testUsingContextAndFs( + String description, + FileSystem filesystem, + dynamic testMethod(), + ) { testUsingContext(description, () async { writeEmptySchemaFile(filesystem);
diff --git a/packages/flutter_tools/test/integration/test_driver.dart b/packages/flutter_tools/test/integration/test_driver.dart index 952f227..dcb011d 100644 --- a/packages/flutter_tools/test/integration/test_driver.dart +++ b/packages/flutter_tools/test/integration/test_driver.dart
@@ -120,7 +120,7 @@ _stderr.stream.listen((String message) => _debugPrint(message, topic: '<=stderr=')); } - Future<void> connectToVmService({bool pauseOnExceptions = false}) async { + Future<void> connectToVmService({ bool pauseOnExceptions = false }) async { _vmService = await vmServiceConnectUri('$_vmServiceWsUri'); _vmService.onSend.listen((String s) => _debugPrint(s, topic: '=vm=>')); _vmService.onReceive.listen((String s) => _debugPrint(s, topic: '<=vm=')); @@ -240,11 +240,11 @@ ); } - Future<Isolate> resume({bool waitForNextPause = false}) => _resume(null, waitForNextPause); - Future<Isolate> stepOver({bool waitForNextPause = true}) => _resume(StepOption.kOver, waitForNextPause); + Future<Isolate> resume({ bool waitForNextPause = false }) => _resume(null, waitForNextPause); + Future<Isolate> stepOver({ bool waitForNextPause = true }) => _resume(StepOption.kOver, waitForNextPause); Future<Isolate> stepOverAsync({ bool waitForNextPause = true }) => _resume(StepOption.kOverAsyncSuspension, waitForNextPause); - Future<Isolate> stepInto({bool waitForNextPause = true}) => _resume(StepOption.kInto, waitForNextPause); - Future<Isolate> stepOut({bool waitForNextPause = true}) => _resume(StepOption.kOut, waitForNextPause); + Future<Isolate> stepInto({ bool waitForNextPause = true }) => _resume(StepOption.kInto, waitForNextPause); + Future<Isolate> stepOut({ bool waitForNextPause = true }) => _resume(StepOption.kOut, waitForNextPause); Future<bool> isAtAsyncSuspension() async { final Isolate isolate = await _getFlutterIsolate(); @@ -354,7 +354,8 @@ ).whenComplete(subscription.cancel); } - Future<T> _timeoutWithMessages<T>(Future<T> Function() callback, { + Future<T> _timeoutWithMessages<T>( + Future<T> Function() callback, { @required String task, Duration timeout = defaultTimeout, }) { @@ -491,10 +492,10 @@ _currentRunningAppId = (await started)['params']['appId']; } - Future<void> hotRestart({bool pause = false}) => _restart(fullRestart: true, pause: pause); + Future<void> hotRestart({ bool pause = false }) => _restart(fullRestart: true, pause: pause); Future<void> hotReload() => _restart(fullRestart: false); - Future<void> _restart({bool fullRestart = false, bool pause = false}) async { + Future<void> _restart({ bool fullRestart = false, bool pause = false }) async { if (_currentRunningAppId == null) throw Exception('App has not started yet');
diff --git a/packages/flutter_tools/test/ios/cocoapods_test.dart b/packages/flutter_tools/test/ios/cocoapods_test.dart index 3a8384c..78454d7 100644 --- a/packages/flutter_tools/test/ios/cocoapods_test.dart +++ b/packages/flutter_tools/test/ios/cocoapods_test.dart
@@ -572,5 +572,5 @@ class MockProcessManager extends Mock implements ProcessManager {} class MockXcodeProjectInterpreter extends Mock implements XcodeProjectInterpreter {} -ProcessResult exitsWithError([String stdout = '']) => ProcessResult(1, 1, stdout, ''); -ProcessResult exitsHappy([String stdout = '']) => ProcessResult(1, 0, stdout, ''); +ProcessResult exitsWithError([ String stdout = '' ]) => ProcessResult(1, 1, stdout, ''); +ProcessResult exitsHappy([ String stdout = '' ]) => ProcessResult(1, 0, stdout, '');
diff --git a/packages/flutter_tools/test/protocol_discovery_test.dart b/packages/flutter_tools/test/protocol_discovery_test.dart index c4e9050..4c71291 100644 --- a/packages/flutter_tools/test/protocol_discovery_test.dart +++ b/packages/flutter_tools/test/protocol_discovery_test.dart
@@ -228,7 +228,7 @@ final int availablePort; @override - Future<int> forward(int devicePort, {int hostPort}) async { + Future<int> forward(int devicePort, { int hostPort }) async { hostPort ??= 0; if (hostPort == 0) { return availablePort;
diff --git a/packages/flutter_tools/test/src/common.dart b/packages/flutter_tools/test/src/common.dart index c672e98..44f6556 100644 --- a/packages/flutter_tools/test/src/common.dart +++ b/packages/flutter_tools/test/src/common.dart
@@ -68,7 +68,7 @@ return fs.path.normalize(fs.path.join(toolsPath, '..', '..')); } -CommandRunner<void> createTestCommandRunner([FlutterCommand command]) { +CommandRunner<void> createTestCommandRunner([ FlutterCommand command ]) { final FlutterCommandRunner runner = FlutterCommandRunner(); if (command != null) runner.addCommand(command); @@ -76,15 +76,17 @@ } /// Updates [path] to have a modification time [seconds] from now. -void updateFileModificationTime(String path, - DateTime baseTime, - int seconds) { +void updateFileModificationTime( + String path, + DateTime baseTime, + int seconds, +) { final DateTime modificationTime = baseTime.add(Duration(seconds: seconds)); fs.file(path).setLastModifiedSync(modificationTime); } /// Matcher for functions that throw [ToolExit]. -Matcher throwsToolExit({int exitCode, Pattern message}) { +Matcher throwsToolExit({ int exitCode, Pattern message }) { Matcher matcher = isToolExit; if (exitCode != null) matcher = allOf(matcher, (ToolExit e) => e.exitCode == exitCode); @@ -97,7 +99,7 @@ final Matcher isToolExit = isInstanceOf<ToolExit>(); /// Matcher for functions that throw [ProcessExit]. -Matcher throwsProcessExit([dynamic exitCode]) { +Matcher throwsProcessExit([ dynamic exitCode ]) { return exitCode == null ? throwsA(isProcessExit) : throwsA(allOf(isProcessExit, (ProcessExit e) => e.exitCode == exitCode)); @@ -109,7 +111,7 @@ /// Creates a flutter project in the [temp] directory using the /// [arguments] list if specified, or `--no-pub` if not. /// Returns the path to the flutter project. -Future<String> createProject(Directory temp, {List<String> arguments}) async { +Future<String> createProject(Directory temp, { List<String> arguments }) async { arguments ??= <String>['--no-pub']; final String projectPath = fs.path.join(temp.path, 'flutter_project'); final CreateCommand command = CreateCommand();
diff --git a/packages/flutter_tools/test/src/context.dart b/packages/flutter_tools/test/src/context.dart index 92ae65e..143a791 100644 --- a/packages/flutter_tools/test/src/context.dart +++ b/packages/flutter_tools/test/src/context.dart
@@ -38,7 +38,9 @@ typedef ContextInitializer = void Function(AppContext testContext); @isTest -void testUsingContext(String description, dynamic testMethod(), { +void testUsingContext( + String description, + dynamic testMethod(), { Timeout timeout, Map<Type, Generator> overrides = const <Type, Generator>{}, bool initializeFlutterRoot = true,
diff --git a/packages/flutter_tools/test/src/mocks.dart b/packages/flutter_tools/test/src/mocks.dart index 3dcc063..015b96e 100644 --- a/packages/flutter_tools/test/src/mocks.dart +++ b/packages/flutter_tools/test/src/mocks.dart
@@ -268,12 +268,12 @@ } @override - void writeln([Object obj = '']) { + void writeln([ Object obj = '' ]) { add(encoding.encode('$obj\n')); } @override - void writeAll(Iterable<dynamic> objects, [String separator = '']) { + void writeAll(Iterable<dynamic> objects, [ String separator = '' ]) { bool addSeparator = false; for (dynamic object in objects) { if (addSeparator) { @@ -285,7 +285,7 @@ } @override - void addError(dynamic error, [StackTrace stackTrace]) { + void addError(dynamic error, [ StackTrace stackTrace ]) { throw UnimplementedError(); } @@ -482,7 +482,7 @@ return null; } @override - Future<CompilerOutput> recompile(String mainPath, List<String> invalidatedFiles, {String outputPath, String packagesFilePath}) async { + Future<CompilerOutput> recompile(String mainPath, List<String> invalidatedFiles, { String outputPath, String packagesFilePath }) async { fs.file(outputPath).createSync(recursive: true); fs.file(outputPath).writeAsStringSync('compiled_kernel_output'); return CompilerOutput(outputPath, 0);
diff --git a/packages/flutter_tools/test/version_test.dart b/packages/flutter_tools/test/version_test.dart index 17963e3..d25c57c 100644 --- a/packages/flutter_tools/test/version_test.dart +++ b/packages/flutter_tools/test/version_test.dart
@@ -442,7 +442,7 @@ }); final Answering<ProcessResult> syncAnswer = (Invocation invocation) { - bool argsAre(String a1, [String a2, String a3, String a4, String a5, String a6, String a7, String a8]) { + bool argsAre(String a1, [ String a2, String a3, String a4, String a5, String a6, String a7, String a8 ]) { const ListEquality<String> equality = ListEquality<String>(); final List<String> args = invocation.positionalArguments.single; final List<String> expectedArgs = <String>[a1, a2, a3, a4, a5, a6, a7, a8].where((String arg) => arg != null).toList();