apply lint prefer_void_to_null in packages/flutter_tools (#22686)
diff --git a/packages/flutter_tools/test/analytics_test.dart b/packages/flutter_tools/test/analytics_test.dart index ee99ace..14e5f0a 100644 --- a/packages/flutter_tools/test/analytics_test.dart +++ b/packages/flutter_tools/test/analytics_test.dart
@@ -52,7 +52,7 @@ count = 0; flutterUsage.enabled = false; final DoctorCommand doctorCommand = DoctorCommand(); - final CommandRunner<Null>runner = createTestCommandRunner(doctorCommand); + final CommandRunner<void>runner = createTestCommandRunner(doctorCommand); await runner.run(<String>['doctor']); expect(count, 0); }, overrides: <Type, Generator>{ @@ -67,7 +67,7 @@ flutterUsage.enabled = false; final ConfigCommand command = ConfigCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['config']); expect(count, 0); @@ -100,7 +100,7 @@ mockTimes = <int>[1000, 2000]; when(mockDoctor.diagnose(androidLicenses: false, verbose: false)).thenAnswer((_) async => true); final DoctorCommand command = DoctorCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['doctor']); verify(mockClock.now()).called(2); @@ -119,7 +119,7 @@ mockTimes = <int>[1000, 2000]; when(mockDoctor.diagnose(androidLicenses: false, verbose: false)).thenAnswer((_) async => false); final DoctorCommand command = DoctorCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['doctor']); verify(mockClock.now()).called(2);
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 a1a584f..a30b8cb 100644 --- a/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart +++ b/packages/flutter_tools/test/asset_bundle_package_fonts_test.dart
@@ -60,7 +60,7 @@ ..writeAsStringSync(packages); } - Future<Null> buildAndVerifyFonts( + Future<void> buildAndVerifyFonts( List<String> localFonts, List<String> packageFonts, List<String> packages,
diff --git a/packages/flutter_tools/test/asset_bundle_package_test.dart b/packages/flutter_tools/test/asset_bundle_package_test.dart index 17b3c42..9ed6f03 100644 --- a/packages/flutter_tools/test/asset_bundle_package_test.dart +++ b/packages/flutter_tools/test/asset_bundle_package_test.dart
@@ -66,7 +66,7 @@ ..writeAsStringSync(packages); } - Future<Null> buildAndVerifyAssets( + Future<void> buildAndVerifyAssets( List<String> assets, List<String> packages, String expectedAssetManifest,
diff --git a/packages/flutter_tools/test/base/flags_test.dart b/packages/flutter_tools/test/base/flags_test.dart index 99122de..e49a7af 100644 --- a/packages/flutter_tools/test/base/flags_test.dart +++ b/packages/flutter_tools/test/base/flags_test.dart
@@ -11,12 +11,12 @@ import '../src/common.dart'; import '../src/context.dart'; -typedef _TestMethod = FutureOr<Null> Function(); +typedef _TestMethod = FutureOr<void> Function(); void main() { Cache.disableLocking(); - Future<Null> runCommand(Iterable<String> flags, _TestMethod testMethod) async { + Future<void> runCommand(Iterable<String> flags, _TestMethod testMethod) async { final List<String> args = <String>['test']..addAll(flags); final _TestCommand command = _TestCommand(testMethod); await createTestCommandRunner(command).run(args);
diff --git a/packages/flutter_tools/test/channel_test.dart b/packages/flutter_tools/test/channel_test.dart index ed12ded..96c2e92 100644 --- a/packages/flutter_tools/test/channel_test.dart +++ b/packages/flutter_tools/test/channel_test.dart
@@ -43,7 +43,7 @@ testUsingContext('list', () async { final ChannelCommand command = ChannelCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel']); expect(testLogger.errorText, hasLength(0)); // The bots may return an empty list of channels (network hiccup?) @@ -65,7 +65,7 @@ )).thenAnswer((_) => Future<Process>.value(process)); final ChannelCommand command = ChannelCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel']); verify(mockProcessManager.start( @@ -106,7 +106,7 @@ )).thenAnswer((_) => Future<Process>.value(createMockProcess())); final ChannelCommand command = ChannelCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel', 'beta']); verify(mockProcessManager.start( @@ -166,7 +166,7 @@ '''); final ChannelCommand command = ChannelCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel', 'beta']); verify(mockProcessManager.start(
diff --git a/packages/flutter_tools/test/commands/analyze_once_test.dart b/packages/flutter_tools/test/commands/analyze_once_test.dart index afae38e..229c569 100644 --- a/packages/flutter_tools/test/commands/analyze_once_test.dart +++ b/packages/flutter_tools/test/commands/analyze_once_test.dart
@@ -191,7 +191,7 @@ } } -Future<Null> runCommand({ +Future<void> runCommand({ FlutterCommand command, List<String> arguments, List<String> statusTextContains,
diff --git a/packages/flutter_tools/test/commands/create_test.dart b/packages/flutter_tools/test/commands/create_test.dart index 10c65eb..ff5bd11 100644 --- a/packages/flutter_tools/test/commands/create_test.dart +++ b/packages/flutter_tools/test/commands/create_test.dart
@@ -234,7 +234,7 @@ when(mockFlutterVersion.channel).thenReturn(frameworkChannel); final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--template=application', '--no-pub', '--org', 'com.foo.bar', projectDir.path]); @@ -305,7 +305,7 @@ when(mockFlutterVersion.channel).thenReturn(frameworkChannel); final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--template=app', '--no-pub', '--org', 'com.foo.bar', projectDir.path]); @@ -374,7 +374,7 @@ Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--no-pub', projectDir.path]); @@ -385,7 +385,7 @@ Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--no-pub', '--template=app', projectDir.path]); @@ -402,7 +402,7 @@ Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--no-pub', '--template=app', projectDir.path]); @@ -416,7 +416,7 @@ Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--no-pub', '--template=plugin', projectDir.path]); @@ -430,7 +430,7 @@ Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--no-pub', '--template=package', projectDir.path]); @@ -555,7 +555,7 @@ Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); expect( runner.run(<String>['create', projectDir.path, '--pub']), @@ -567,7 +567,7 @@ testUsingContext('fails when file exists', () async { Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); final File existingFile = fs.file('${projectDir.path.toString()}/bad'); if (!existingFile.existsSync()) { existingFile.createSync(recursive: true); @@ -581,7 +581,7 @@ testUsingContext('fails when invalid package name', () async { Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); expect( runner.run(<String>['create', fs.path.join(projectDir.path, 'invalidName')]), throwsToolExit(message: '"invalidName" is not a valid Dart package name.'), @@ -594,7 +594,7 @@ Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--pub', '--offline', projectDir.path]); expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]pub'))); @@ -612,7 +612,7 @@ Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', '--pub', projectDir.path]); expect(loggingProcessManager.commands.first, contains(matches(r'dart-sdk[\\/]bin[\\/]pub'))); @@ -625,7 +625,7 @@ ); } -Future<Null> _createProject( +Future<void> _createProject( Directory dir, List<String> createArgs, List<String> expectedPaths, { @@ -633,7 +633,7 @@ }) async { Cache.flutterRoot = '../..'; final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); final List<String> args = <String>['create']; args.addAll(createArgs); args.add(dir.path); @@ -658,7 +658,7 @@ expect(failures, isEmpty, reason: failures.join('\n')); } -Future<Null> _createAndAnalyzeProject( +Future<void> _createAndAnalyzeProject( Directory dir, List<String> createArgs, List<String> expectedPaths, { @@ -668,7 +668,7 @@ await _analyzeProject(dir.path); } -Future<Null> _analyzeProject(String workingDir) async { +Future<void> _analyzeProject(String workingDir) async { final String flutterToolsPath = fs.path.absolute(fs.path.join( 'bin', 'flutter_tools.dart', @@ -691,7 +691,7 @@ expect(exec.exitCode, 0); } -Future<Null> _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',
diff --git a/packages/flutter_tools/test/commands/daemon_test.dart b/packages/flutter_tools/test/commands/daemon_test.dart index b1315ea..fbdd8c4 100644 --- a/packages/flutter_tools/test/commands/daemon_test.dart +++ b/packages/flutter_tools/test/commands/daemon_test.dart
@@ -84,7 +84,7 @@ ); printStatus('daemon.logMessage test'); // Service the event loop. - await Future<Null>.value(); + await Future<void>.value(); }, zoneSpecification: ZoneSpecification(print: (Zone self, ZoneDelegate parent, Zone zone, String line) { buffer.writeln(line); })); @@ -103,7 +103,7 @@ notifyingLogger: notifyingLogger ); commands.add(<String, dynamic>{'id': 0, 'method': 'daemon.shutdown'}); - return daemon.onExit.then<Null>((int code) async { + return daemon.onExit.then<void>((int code) async { await commands.close(); expect(code, 0); });
diff --git a/packages/flutter_tools/test/commands/format_test.dart b/packages/flutter_tools/test/commands/format_test.dart index 526fa38..f3878cf 100644 --- a/packages/flutter_tools/test/commands/format_test.dart +++ b/packages/flutter_tools/test/commands/format_test.dart
@@ -31,7 +31,7 @@ srcFile.writeAsStringSync(original.replaceFirst('main()', 'main( )')); final FormatCommand command = FormatCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['format', srcFile.path]); final String formatted = srcFile.readAsStringSync(); @@ -48,7 +48,7 @@ srcFile.writeAsStringSync(nonFormatted); final FormatCommand command = FormatCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['format', '--dry-run', srcFile.path]); final String shouldNotFormatted = srcFile.readAsStringSync(); @@ -65,7 +65,7 @@ srcFile.writeAsStringSync(nonFormatted); final FormatCommand command = FormatCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); expect(runner.run(<String>[ 'format', '--dry-run', '--set-exit-if-changed', srcFile.path
diff --git a/packages/flutter_tools/test/commands/ide_config_test.dart b/packages/flutter_tools/test/commands/ide_config_test.dart index 1e7a0fe..f3959a1 100644 --- a/packages/flutter_tools/test/commands/ide_config_test.dart +++ b/packages/flutter_tools/test/commands/ide_config_test.dart
@@ -76,7 +76,7 @@ return fs.file(absPath).existsSync() || fs.directory(absPath).existsSync(); } - Future<Null> _updateIdeConfig({ + Future<void> _updateIdeConfig({ Directory dir, List<String> args = const <String>[], Map<String, String> expectedContents = const <String, String>{}, @@ -84,7 +84,7 @@ }) async { dir ??= tempDir; final IdeConfigCommand command = IdeConfigCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); final List<String> finalArgs = <String>['--flutter-root=${tempDir.absolute.path}', 'ide-config']; finalArgs.addAll(args); await runner.run(finalArgs);
diff --git a/packages/flutter_tools/test/commands/packages_test.dart b/packages/flutter_tools/test/commands/packages_test.dart index 34dab67..c8cad27 100644 --- a/packages/flutter_tools/test/commands/packages_test.dart +++ b/packages/flutter_tools/test/commands/packages_test.dart
@@ -57,9 +57,9 @@ return projectPath; } - Future<Null> runCommandIn(String projectPath, String verb, { List<String> args }) async { + Future<void> runCommandIn(String projectPath, String verb, { List<String> args }) async { final PackagesCommand command = PackagesCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); final List<String> commandArgs = <String>['packages', verb]; if (args != null) @@ -307,12 +307,12 @@ testUsingContext('publish', () async { final PromptingProcess process = PromptingProcess(); mockProcessManager.processFactory = (List<String> commands) => process; - final Future<Null> runPackages = createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'pub', 'publish']); - final Future<Null> runPrompt = process.showPrompt('Proceed (y/n)? ', <String>['hello', 'world']); - final Future<Null> simulateUserInput = Future<Null>(() { + final Future<void> runPackages = createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'pub', 'publish']); + final Future<void> runPrompt = process.showPrompt('Proceed (y/n)? ', <String>['hello', 'world']); + final Future<void> simulateUserInput = Future<void>(() { mockStdio.simulateStdin('y'); }); - await Future.wait<Null>(<Future<Null>>[runPackages, runPrompt, simulateUserInput]); + await Future.wait<void>(<Future<void>>[runPackages, runPrompt, simulateUserInput]); final List<String> commands = mockProcessManager.commands; expect(commands, hasLength(2)); expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
diff --git a/packages/flutter_tools/test/commands/test_test.dart b/packages/flutter_tools/test/commands/test_test.dart index d0d3787..4c05295 100644 --- a/packages/flutter_tools/test/commands/test_test.dart +++ b/packages/flutter_tools/test/commands/test_test.dart
@@ -15,7 +15,7 @@ // This test depends on some files in ///dev/automated_tests/flutter_test/* -Future<Null> _testExclusionLock; +Future<void> _testExclusionLock; void main() { group('flutter test should', () { @@ -90,7 +90,7 @@ }); } -Future<Null> _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); @@ -171,7 +171,7 @@ while (_testExclusionLock != null) await _testExclusionLock; - final Completer<Null> testExclusionCompleter = Completer<Null>(); + final Completer<void> testExclusionCompleter = Completer<void>(); _testExclusionLock = testExclusionCompleter.future; try { return await Process.run(
diff --git a/packages/flutter_tools/test/compile_test.dart b/packages/flutter_tools/test/compile_test.dart index 2428559..879304c 100644 --- a/packages/flutter_tools/test/compile_test.dart +++ b/packages/flutter_tools/test/compile_test.dart
@@ -376,7 +376,7 @@ }); } -Future<Null> _recompile(StreamController<List<int>> streamController, +Future<void> _recompile(StreamController<List<int>> streamController, ResidentCompiler generator, MockStdIn mockFrontendServerStdIn, String mockCompilerOutput) async { // Put content into the output stream after generator.recompile gets
diff --git a/packages/flutter_tools/test/crash_reporting_test.dart b/packages/flutter_tools/test/crash_reporting_test.dart index 2eab591..efbbf21 100644 --- a/packages/flutter_tools/test/crash_reporting_test.dart +++ b/packages/flutter_tools/test/crash_reporting_test.dart
@@ -173,7 +173,7 @@ String get name => 'crash'; @override - Future<Null> runCommand() async { + Future<FlutterCommandResult> runCommand() async { void fn1() { throw StateError('Test bad state error'); } @@ -187,6 +187,8 @@ } fn3(); + + return null; } }
diff --git a/packages/flutter_tools/test/dart/pub_get_test.dart b/packages/flutter_tools/test/dart/pub_get_test.dart index ec4773f..a4c4d2c 100644 --- a/packages/flutter_tools/test/dart/pub_get_test.dart +++ b/packages/flutter_tools/test/dart/pub_get_test.dart
@@ -32,7 +32,7 @@ FakeAsync().run((FakeAsync time) { expect(processMock.lastPubEnvironment, isNull); expect(testLogger.statusText, ''); - pubGet(context: PubContext.flutterTests, checkLastModified: false).then((Null value) { + pubGet(context: PubContext.flutterTests, checkLastModified: false).then((void value) { error = 'test completed unexpectedly'; }, onError: (dynamic thrownError) { error = 'test failed unexpectedly: $thrownError'; @@ -102,7 +102,7 @@ MockDirectory.findCache = true; expect(processMock.lastPubEnvironment, isNull); expect(processMock.lastPubCache, isNull); - pubGet(context: PubContext.flutterTests, checkLastModified: false).then((Null value) { + pubGet(context: PubContext.flutterTests, checkLastModified: false).then((void value) { error = 'test completed unexpectedly'; }, onError: (dynamic thrownError) { error = 'test failed unexpectedly: $thrownError'; @@ -128,7 +128,7 @@ MockDirectory.findCache = true; expect(processMock.lastPubEnvironment, isNull); expect(processMock.lastPubCache, isNull); - pubGet(context: PubContext.flutterTests, checkLastModified: false).then((Null value) { + pubGet(context: PubContext.flutterTests, checkLastModified: false).then((void value) { error = 'test completed unexpectedly'; }, onError: (dynamic thrownError) { error = 'test failed unexpectedly: $thrownError'; @@ -213,7 +213,7 @@ Future<E> asFuture<E>([E futureValue]) => Future<E>.value(); @override - Future<Null> cancel() => null; + Future<void> cancel() => null; @override dynamic noSuchMethod(Invocation invocation) => null;
diff --git a/packages/flutter_tools/test/devfs_test.dart b/packages/flutter_tools/test/devfs_test.dart index d3c72bc..ab0ee76 100644 --- a/packages/flutter_tools/test/devfs_test.dart +++ b/packages/flutter_tools/test/devfs_test.dart
@@ -438,7 +438,7 @@ @override VM get vm => _vm; - Future<Null> setUp() async { + Future<void> setUp() async { try { _server = await HttpServer.bind(InternetAddress.loopbackIPv6, 0); _httpAddress = Uri.parse('http://[::1]:${_server.port}'); @@ -451,7 +451,7 @@ final String fsName = request.headers.value('dev_fs_name'); final String devicePath = utf8.decode(base64.decode(request.headers.value('dev_fs_uri_b64'))); messages.add('writeFile $fsName $devicePath'); - request.drain<List<int>>().then<Null>((List<int> value) { + request.drain<List<int>>().then<void>((List<int> value) { request.response ..write('Got it') ..close(); @@ -459,7 +459,7 @@ }); } - Future<Null> tearDown() async { + Future<void> tearDown() async { await _server?.close(); } @@ -522,7 +522,7 @@ tryToDelete(_tempDirs.removeLast()); } -Future<Null> _createPackage(FileSystem fs, String pkgName, String pkgFileName, { bool doubleSlash = false }) async { +Future<void> _createPackage(FileSystem fs, String pkgName, String pkgFileName, { bool doubleSlash = false }) async { final Directory pkgTempDir = _newTempDir(fs); String pkgFilePath = fs.path.join(pkgTempDir.path, pkgName, 'lib', pkgFileName); if (doubleSlash) {
diff --git a/packages/flutter_tools/test/device_test.dart b/packages/flutter_tools/test/device_test.dart index db32c3d..4b199c7 100644 --- a/packages/flutter_tools/test/device_test.dart +++ b/packages/flutter_tools/test/device_test.dart
@@ -25,7 +25,7 @@ final List<Device> devices = <Device>[device1, device2, device3]; final DeviceManager deviceManager = TestDeviceManager(devices); - Future<Null> expectDevice(String id, List<Device> expected) async { + Future<void> expectDevice(String id, List<Device> expected) async { expect(await deviceManager.getDevicesById(id).toList(), expected); } await expectDevice('01abfc49119c410e', <Device>[device2]);
diff --git a/packages/flutter_tools/test/emulator_test.dart b/packages/flutter_tools/test/emulator_test.dart index 0bb1499..59b276d 100644 --- a/packages/flutter_tools/test/emulator_test.dart +++ b/packages/flutter_tools/test/emulator_test.dart
@@ -58,7 +58,7 @@ final TestEmulatorManager testEmulatorManager = TestEmulatorManager(emulators); - Future<Null> expectEmulator(String id, List<Emulator> expected) async { + Future<void> expectEmulator(String id, List<Emulator> expected) async { expect(await testEmulatorManager.getEmulatorsMatching(id), expected); }
diff --git a/packages/flutter_tools/test/project_test.dart b/packages/flutter_tools/test/project_test.dart index c17d6f0..80248ba 100644 --- a/packages/flutter_tools/test/project_test.dart +++ b/packages/flutter_tools/test/project_test.dart
@@ -234,7 +234,7 @@ mockXcodeProjectInterpreter = MockXcodeProjectInterpreter(); }); - void testWithMocks(String description, Future<Null> testMethod()) { + void testWithMocks(String description, Future<void> testMethod()) { testUsingContext(description, testMethod, overrides: <Type, Generator>{ FileSystem: () => fs, IOSWorkflow: () => mockIOSWorkflow, @@ -365,7 +365,7 @@ /// Executes the [testMethod] in a context where the file system /// is in memory. -void testInMemory(String description, Future<Null> testMethod()) { +void testInMemory(String description, Future<void> testMethod()) { Cache.flutterRoot = getFlutterRoot(); final FileSystem testFileSystem = MemoryFileSystem( style: platform.isWindows ? FileSystemStyle.windows : FileSystemStyle.posix, @@ -406,7 +406,7 @@ } } -Future<Null> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher) async { +Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher) async { try { await future; fail('ToolExit expected, but nothing thrown');
diff --git a/packages/flutter_tools/test/protocol_discovery_test.dart b/packages/flutter_tools/test/protocol_discovery_test.dart index d8499f2..c4e9050 100644 --- a/packages/flutter_tools/test/protocol_discovery_test.dart +++ b/packages/flutter_tools/test/protocol_discovery_test.dart
@@ -240,7 +240,7 @@ List<ForwardedPort> get forwardedPorts => throw 'not implemented'; @override - Future<Null> unforward(ForwardedPort forwardedPort) { + Future<void> unforward(ForwardedPort forwardedPort) { throw 'not implemented'; } }
diff --git a/packages/flutter_tools/test/resident_runner_test.dart b/packages/flutter_tools/test/resident_runner_test.dart index fd50df4..30c07b8 100644 --- a/packages/flutter_tools/test/resident_runner_test.dart +++ b/packages/flutter_tools/test/resident_runner_test.dart
@@ -18,13 +18,13 @@ String receivedCommand; @override - Future<Null> cleanupAfterSignal() => null; + Future<void> cleanupAfterSignal() => null; @override - Future<Null> cleanupAtFinish() => null; + Future<void> cleanupAtFinish() => null; @override - Future<Null> handleTerminalCommand(String code) async { + Future<void> handleTerminalCommand(String code) async { receivedCommand = code; }
diff --git a/packages/flutter_tools/test/runner/flutter_command_test.dart b/packages/flutter_tools/test/runner/flutter_command_test.dart index 2e78161..7c3464a 100644 --- a/packages/flutter_tools/test/runner/flutter_command_test.dart +++ b/packages/flutter_tools/test/runner/flutter_command_test.dart
@@ -188,7 +188,7 @@ @override Future<FlutterCommandResult> runCommand() async { - return commandFunction == null ? null : commandFunction(); + return commandFunction == null ? null : await commandFunction(); } }
diff --git a/packages/flutter_tools/test/src/common.dart b/packages/flutter_tools/test/src/common.dart index 34627bf..a3e2039 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<Null> createTestCommandRunner([FlutterCommand command]) { +CommandRunner<void> createTestCommandRunner([FlutterCommand command]) { final FlutterCommandRunner runner = FlutterCommandRunner(); if (command != null) runner.addCommand(command); @@ -113,7 +113,7 @@ arguments ??= <String>['--no-pub']; final String projectPath = fs.path.join(temp.path, 'flutter_project'); final CreateCommand command = CreateCommand(); - final CommandRunner<Null> runner = createTestCommandRunner(command); + final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create']..addAll(arguments)..add(projectPath)); return projectPath; }
diff --git a/packages/flutter_tools/test/src/context.dart b/packages/flutter_tools/test/src/context.dart index e458d93..5721d0f 100644 --- a/packages/flutter_tools/test/src/context.dart +++ b/packages/flutter_tools/test/src/context.dart
@@ -262,7 +262,7 @@ Stream<Map<String, dynamic>> get onSend => null; @override - Future<Null> ensureAnalyticsSent() => Future<Null>.value(); + Future<void> ensureAnalyticsSent() => Future<void>.value(); @override void printWelcome() { }
diff --git a/packages/flutter_tools/test/src/mocks.dart b/packages/flutter_tools/test/src/mocks.dart index eec77f1..a22872a 100644 --- a/packages/flutter_tools/test/src/mocks.dart +++ b/packages/flutter_tools/test/src/mocks.dart
@@ -173,7 +173,7 @@ /// A process that prompts the user to proceed, then asynchronously writes /// some lines to stdout before it exits. class PromptingProcess implements Process { - Future<Null> showPrompt(String prompt, List<String> outputLines) async { + Future<void> showPrompt(String prompt, List<String> outputLines) async { _stdoutController.add(utf8.encode(prompt)); final List<int> bytesOnStdin = await _stdin.future; // Echo stdin to stdout. @@ -234,11 +234,11 @@ } @override - Future<Null> addStream(Stream<List<int>> stream) { - final Completer<Null> completer = Completer<Null>(); + Future<void> addStream(Stream<List<int>> stream) { + final Completer<void> completer = Completer<void>(); stream.listen((List<int> data) { add(data); - }).onDone(() => completer.complete(null)); + }).onDone(() => completer.complete()); return completer.future; } @@ -275,13 +275,13 @@ } @override - Future<Null> get done => close(); + Future<void> get done => close(); @override - Future<Null> close() async => null; + Future<void> close() async => null; @override - Future<Null> flush() async => null; + Future<void> flush() async => null; } /// A Stdio that collects stdout and supports simulated stdin.
diff --git a/packages/flutter_tools/test/utils_test.dart b/packages/flutter_tools/test/utils_test.dart index 513a75d..17992c3 100644 --- a/packages/flutter_tools/test/utils_test.dart +++ b/packages/flutter_tools/test/utils_test.dart
@@ -134,7 +134,7 @@ called = true; }, const Duration(seconds: 1)); expect(called, false); - await Future<Null>.delayed(kShortDelay); + await Future<void>.delayed(kShortDelay); expect(called, true); }); @@ -145,7 +145,7 @@ callCount++; }, Duration(milliseconds: kShortDelay.inMilliseconds ~/ 2)); expect(callCount, 0); - await Future<Null>.delayed(kShortDelay); + await Future<void>.delayed(kShortDelay); expect(callCount, greaterThanOrEqualTo(2)); }); @@ -160,7 +160,7 @@ completer.complete(DateTime.now().difference(firstTime)); // introduce a delay - await Future<Null>.delayed(kShortDelay); + await Future<void>.delayed(kShortDelay); }, kShortDelay); final Duration duration = await completer.future; expect(duration, greaterThanOrEqualTo(Duration(milliseconds: kShortDelay.inMilliseconds * 2)));