add missing type parameter on methods (#22096)

This commit is contained in:
Alexandre Ardhuin 2018-10-01 21:29:08 +02:00 committed by GitHub
parent 48fb726b01
commit f62afdcf57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
211 changed files with 504 additions and 503 deletions

View File

@ -494,7 +494,7 @@ class ItemGalleryBox extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: TabBarView( child: TabBarView(
children: tabNames.map((String tabName) { children: tabNames.map<Widget>((String tabName) {
return Container( return Container(
key: PageStorageKey<String>(tabName), key: PageStorageKey<String>(tabName),
child: Padding( child: Padding(

View File

@ -207,8 +207,8 @@ Future<EvalResult> _evalCommand(String executable, List<String> arguments, {
final Future<List<List<int>>> savedStderr = process.stderr.toList(); final Future<List<List<int>>> savedStderr = process.stderr.toList();
final int exitCode = await process.exitCode; final int exitCode = await process.exitCode;
final EvalResult result = EvalResult( final EvalResult result = EvalResult(
stdout: utf8.decode((await savedStdout).expand((List<int> ints) => ints).toList()), stdout: utf8.decode((await savedStdout).expand<int>((List<int> ints) => ints).toList()),
stderr: utf8.decode((await savedStderr).expand((List<int> ints) => ints).toList()), stderr: utf8.decode((await savedStderr).expand<int>((List<int> ints) => ints).toList()),
exitCode: exitCode, exitCode: exitCode,
); );
@ -328,13 +328,13 @@ Future<Null> _verifyNoBadImportsInFlutter(String workingDirectory) async {
.whereType<Directory>() .whereType<Directory>()
.map<String>((Directory entity) => path.basename(entity.path)) .map<String>((Directory entity) => path.basename(entity.path))
.toList()..sort(); .toList()..sort();
if (!_matches(packages, directories)) { if (!_matches<String>(packages, directories)) {
errors.add( errors.add(
'flutter/lib/*.dart does not match flutter/lib/src/*/:\n' 'flutter/lib/*.dart does not match flutter/lib/src/*/:\n'
'These are the exported packages:\n' + 'These are the exported packages:\n' +
packages.map((String path) => ' lib/$path.dart').join('\n') + packages.map<String>((String path) => ' lib/$path.dart').join('\n') +
'These are the directories:\n' + 'These are the directories:\n' +
directories.map((String path) => ' lib/src/$path/').join('\n') directories.map<String>((String path) => ' lib/src/$path/').join('\n')
); );
} }
// Verify that the imports are well-ordered. // Verify that the imports are well-ordered.
@ -350,7 +350,7 @@ Future<Null> _verifyNoBadImportsInFlutter(String workingDirectory) async {
} }
} }
for (String package in dependencyMap.keys) { for (String package in dependencyMap.keys) {
final List<String> loop = _deepSearch(dependencyMap, package); final List<String> loop = _deepSearch<String>(dependencyMap, package);
if (loop != null) { if (loop != null) {
errors.add( errors.add(
'${yellow}Dependency loop:$reset ' + '${yellow}Dependency loop:$reset ' +
@ -421,7 +421,7 @@ List<T> _deepSearch<T>(Map<T, Set<T>> map, T start, [ Set<T> seen ]) {
continue; // we catch these separately continue; // we catch these separately
if (seen != null && seen.contains(key)) if (seen != null && seen.contains(key))
return <T>[start, key]; return <T>[start, key];
final List<T> result = _deepSearch( final List<T> result = _deepSearch<T>(
map, map,
key, key,
(seen == null ? Set<T>.from(<T>[start]) : Set<T>.from(seen))..add(key), (seen == null ? Set<T>.from(<T>[start]) : Set<T>.from(seen))..add(key),

View File

@ -587,7 +587,7 @@ Future<Null> main(List<String> argList) async {
argParser.addOption( argParser.addOption(
'branch', 'branch',
defaultsTo: null, defaultsTo: null,
allowed: Branch.values.map((Branch branch) => getBranchName(branch)), allowed: Branch.values.map<String>((Branch branch) => getBranchName(branch)),
help: 'The Flutter branch to build the archive with. Required.', help: 'The Flutter branch to build the archive with. Required.',
); );
argParser.addOption( argParser.addOption(

View File

@ -56,7 +56,7 @@ Future<Null> runCommand(String executable, List<String> arguments, {
Future<List<List<int>>> savedStdout, savedStderr; Future<List<List<int>>> savedStdout, savedStderr;
if (printOutput) { if (printOutput) {
await Future.wait(<Future<void>>[ await Future.wait<void>(<Future<void>>[
stdout.addStream(process.stdout), stdout.addStream(process.stdout),
stderr.addStream(process.stderr) stderr.addStream(process.stderr)
]); ]);
@ -75,8 +75,8 @@ Future<Null> runCommand(String executable, List<String> arguments, {
print(failureMessage); print(failureMessage);
} }
if (!printOutput) { if (!printOutput) {
stdout.writeln(utf8.decode((await savedStdout).expand((List<int> ints) => ints).toList())); stdout.writeln(utf8.decode((await savedStdout).expand<int>((List<int> ints) => ints).toList()));
stderr.writeln(utf8.decode((await savedStderr).expand((List<int> ints) => ints).toList())); stderr.writeln(utf8.decode((await savedStderr).expand<int>((List<int> ints) => ints).toList()));
} }
print( print(
'$redLine\n' '$redLine\n'

View File

@ -13,8 +13,8 @@ void main() {
'../../bin/cache/dart-sdk/bin/dart', '../../bin/cache/dart-sdk/bin/dart',
<String>['analyze-sample-code.dart', 'test/analyze-sample-code-test-input'], <String>['analyze-sample-code.dart', 'test/analyze-sample-code-test-input'],
); );
final List<String> stdout = await process.stdout.transform(utf8.decoder).transform(const LineSplitter()).toList(); final List<String> stdout = await process.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).toList();
final List<String> stderr = await process.stderr.transform(utf8.decoder).transform(const LineSplitter()).toList(); final List<String> stderr = await process.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).toList();
final Match line = RegExp(r'^(.+)/main\.dart:[0-9]+:[0-9]+: .+$').matchAsPrefix(stdout[1]); final Match line = RegExp(r'^(.+)/main\.dart:[0-9]+:[0-9]+: .+$').matchAsPrefix(stdout[1]);
expect(line, isNot(isNull)); expect(line, isNot(isNull));
final String directory = line.group(1); final String directory = line.group(1);

View File

@ -30,8 +30,8 @@ void main() {
); );
final StreamController<String> stdout = StreamController<String>.broadcast(); final StreamController<String> stdout = StreamController<String>.broadcast();
run.stdout run.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('run:stdout: $line'); print('run:stdout: $line');
stdout.add(line); stdout.add(line);
@ -46,12 +46,12 @@ void main() {
} }
}); });
run.stderr run.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
stderr.writeln('run:stderr: $line'); stderr.writeln('run:stderr: $line');
}); });
run.exitCode.then((int exitCode) { ok = false; }); run.exitCode.then<void>((int exitCode) { ok = false; });
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]); await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
if (!ok) if (!ok)
throw 'Failed to run test app.'; throw 'Failed to run test app.';
@ -114,14 +114,14 @@ class DriveHelper {
<String>['drive', '--use-existing-app', 'http://127.0.0.1:$vmServicePort/', '--keep-app-running', '--driver', 'test_driver/commands_${name}_test.dart'], <String>['drive', '--use-existing-app', 'http://127.0.0.1:$vmServicePort/', '--keep-app-running', '--driver', 'test_driver/commands_${name}_test.dart'],
); );
drive.stdout drive.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('drive:stdout: $line'); print('drive:stdout: $line');
}); });
drive.stderr drive.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
stderr.writeln('drive:stderr: $line'); stderr.writeln('drive:stderr: $line');
}); });

View File

@ -21,7 +21,7 @@ Future<Null> main() async {
int publicMembers = 0; int publicMembers = 0;
int otherErrors = 0; int otherErrors = 0;
int otherLines = 0; int otherLines = 0;
await for (String entry in analysis.stdout.transform(utf8.decoder).transform(const LineSplitter())) { await for (String entry in analysis.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
entry = entry.trim(); entry = entry.trim();
print('analyzer stdout: $entry'); print('analyzer stdout: $entry');
if (entry == 'Building flutter tool...') { if (entry == 'Building flutter tool...') {
@ -36,7 +36,7 @@ Future<Null> main() async {
otherLines += 1; otherLines += 1;
} }
} }
await for (String entry in analysis.stderr.transform(utf8.decoder).transform(const LineSplitter())) { await for (String entry in analysis.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
print('analyzer stderr: $entry'); print('analyzer stderr: $entry');
if (entry.startsWith('[lint] ')) { if (entry.startsWith('[lint] ')) {
// ignore this line // ignore this line

View File

@ -26,8 +26,8 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
int exitCode; int exitCode;
process.stdout process.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('attach:stdout: $line'); print('attach:stdout: $line');
stdout.add(line); stdout.add(line);
@ -43,14 +43,14 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
finished.complete(); finished.complete();
}); });
process.stderr process.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('run:stderr: $line'); print('run:stderr: $line');
stdout.add(line); stdout.add(line);
}); });
process.exitCode.then((int processExitCode) { exitCode = processExitCode; }); process.exitCode.then<void>((int processExitCode) { exitCode = processExitCode; });
Future<dynamic> eventOrExit(Future<Null> event) { Future<dynamic> eventOrExit(Future<Null> event) {
return Future.any<dynamic>(<Future<dynamic>>[ event, process.exitCode ]); return Future.any<dynamic>(<Future<dynamic>>[ event, process.exitCode ]);

View File

@ -45,7 +45,7 @@ Future<int> runTest() async {
); );
int badLines = 0; int badLines = 0;
TestStep step = TestStep.starting; TestStep step = TestStep.starting;
await for (String entry in analysis.stdout.transform(utf8.decoder).transform(const LineSplitter())) { await for (String entry in analysis.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
print('test stdout ($step): $entry'); print('test stdout ($step): $entry');
if (step == TestStep.starting && entry == 'Building flutter tool...') { if (step == TestStep.starting && entry == 'Building flutter tool...') {
// ignore this line // ignore this line
@ -76,7 +76,7 @@ Future<int> runTest() async {
} }
} }
} }
await for (String entry in analysis.stderr.transform(utf8.decoder).transform(const LineSplitter())) { await for (String entry in analysis.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
print('test stderr: $entry'); print('test stderr: $entry');
badLines += 1; badLines += 1;
} }

View File

@ -297,7 +297,7 @@ class _Dependencies {
.replaceAllMapped(_separatorExpr, (Match match) => '${match.group(1)}\n') .replaceAllMapped(_separatorExpr, (Match match) => '${match.group(1)}\n')
.split('\n') .split('\n')
// Expand escape sequences, so that '\ ', for example,ß becomes ' ' // Expand escape sequences, so that '\ ', for example,ß becomes ' '
.map((String path) => path.replaceAllMapped(_escapeExpr, (Match match) => match.group(1)).trim()) .map<String>((String path) => path.replaceAllMapped(_escapeExpr, (Match match) => match.group(1)).trim())
.where((String path) => path.isNotEmpty) .where((String path) => path.isNotEmpty)
.toSet(); .toSet();
} }

View File

@ -37,8 +37,8 @@ void main() {
<String>['run', '--verbose', '-d', device.deviceId, '--route', '/smuggle-it', 'lib/route.dart'], <String>['run', '--verbose', '-d', device.deviceId, '--route', '/smuggle-it', 'lib/route.dart'],
); );
run.stdout run.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('run:stdout: $line'); print('run:stdout: $line');
if (vmServicePort == null) { if (vmServicePort == null) {
@ -52,12 +52,12 @@ void main() {
} }
}); });
run.stderr run.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
stderr.writeln('run:stderr: $line'); stderr.writeln('run:stderr: $line');
}); });
run.exitCode.then((int exitCode) { ok = false; }); run.exitCode.then<void>((int exitCode) { ok = false; });
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]); await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
if (!ok) if (!ok)
throw 'Failed to run test app.'; throw 'Failed to run test app.';
@ -67,14 +67,14 @@ void main() {
<String>['drive', '--use-existing-app', 'http://127.0.0.1:$vmServicePort/', '--no-keep-app-running', 'lib/route.dart'], <String>['drive', '--use-existing-app', 'http://127.0.0.1:$vmServicePort/', '--no-keep-app-running', 'lib/route.dart'],
); );
drive.stdout drive.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('drive:stdout: $line'); print('drive:stdout: $line');
}); });
drive.stderr drive.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
stderr.writeln('drive:stderr: $line'); stderr.writeln('drive:stderr: $line');
}); });

View File

@ -27,7 +27,7 @@ void main() {
} }
Stream<String> transformToLines(Stream<List<int>> byteStream) { Stream<String> transformToLines(Stream<List<int>> byteStream) {
return byteStream.transform(utf8.decoder).transform(const LineSplitter()); return byteStream.transform<String>(utf8.decoder).transform<String>(const LineSplitter());
} }
task(() async { task(() async {
@ -74,7 +74,7 @@ void main() {
transformToLines(run.stderr).listen((String line) { transformToLines(run.stderr).listen((String line) {
stderr.writeln('run:stderr: $line'); stderr.writeln('run:stderr: $line');
}); });
run.exitCode.then((int exitCode) { run.exitCode.then<void>((int exitCode) {
ok = false; ok = false;
}); });
await Future.any<dynamic>(<Future<dynamic>>[ready.future, run.exitCode]); await Future.any<dynamic>(<Future<dynamic>>[ready.future, run.exitCode]);

View File

@ -29,8 +29,8 @@ void main() {
final List<String> stderr = <String>[]; final List<String> stderr = <String>[];
int runExitCode; int runExitCode;
run.stdout run.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('run:stdout: $line'); print('run:stdout: $line');
stdout.add(line); stdout.add(line);
@ -38,13 +38,13 @@ void main() {
ready.complete(); ready.complete();
}); });
run.stderr run.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('run:stderr: $line'); print('run:stderr: $line');
stdout.add(line); stdout.add(line);
}); });
run.exitCode.then((int exitCode) { runExitCode = exitCode; }); run.exitCode.then<void>((int exitCode) { runExitCode = exitCode; });
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]); await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
if (runExitCode != null) if (runExitCode != null)
throw 'Failed to run test app; runner unexpected exited, with exit code $runExitCode.'; throw 'Failed to run test app; runner unexpected exited, with exit code $runExitCode.';

View File

@ -29,8 +29,8 @@ void main() {
<String>['run', '--verbose', '-d', device.deviceId, 'lib/main.dart'], <String>['run', '--verbose', '-d', device.deviceId, 'lib/main.dart'],
); );
run.stdout run.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('run:stdout: $line'); print('run:stdout: $line');
if (vmServicePort == null) { if (vmServicePort == null) {
@ -44,12 +44,12 @@ void main() {
} }
}); });
run.stderr run.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
stderr.writeln('run:stderr: $line'); stderr.writeln('run:stderr: $line');
}); });
run.exitCode.then((int exitCode) { ok = false; }); run.exitCode.then<void>((int exitCode) { ok = false; });
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]); await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
if (!ok) if (!ok)
throw 'Failed to run test app.'; throw 'Failed to run test app.';

View File

@ -54,7 +54,7 @@ Future<double> findCostsForRepo() async {
workingDirectory: flutterDirectory.path, workingDirectory: flutterDirectory.path,
); );
double total = 0.0; double total = 0.0;
await for (String entry in git.stdout.transform(utf8.decoder).transform(const LineSplitter())) await for (String entry in git.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()))
total += await findCostsForFile(File(path.join(flutterDirectory.path, entry))); total += await findCostsForFile(File(path.join(flutterDirectory.path, entry)));
final int gitExitCode = await git.exitCode; final int gitExitCode = await git.exitCode;
if (gitExitCode != 0) if (gitExitCode != 0)

View File

@ -129,7 +129,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
@override @override
Future<Null> chooseWorkingDevice() async { Future<Null> chooseWorkingDevice() async {
final List<Device> allDevices = (await discoverDevices()) final List<Device> allDevices = (await discoverDevices())
.map((String id) => AndroidDevice(deviceId: id)) .map<Device>((String id) => AndroidDevice(deviceId: id))
.toList(); .toList();
if (allDevices.isEmpty) if (allDevices.isEmpty)
@ -298,19 +298,19 @@ class AndroidDevice implements Device {
await adb(<String>['logcat', '--clear']); await adb(<String>['logcat', '--clear']);
final Process process = await startProcess(adbPath, <String>['-s', deviceId, 'logcat']); final Process process = await startProcess(adbPath, <String>['-s', deviceId, 'logcat']);
process.stdout process.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('adb logcat: $line'); print('adb logcat: $line');
stream.sink.add(line); stream.sink.add(line);
}, onDone: () { stdoutDone.complete(); }); }, onDone: () { stdoutDone.complete(); });
process.stderr process.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('adb logcat stderr: $line'); print('adb logcat stderr: $line');
}, onDone: () { stderrDone.complete(); }); }, onDone: () { stderrDone.complete(); });
process.exitCode.then((int exitCode) { process.exitCode.then<void>((int exitCode) {
print('adb logcat process terminated with exit code $exitCode'); print('adb logcat process terminated with exit code $exitCode');
if (!aborted) { if (!aborted) {
stream.addError(BuildFailedError('adb logcat failed with exit code $exitCode.')); stream.addError(BuildFailedError('adb logcat failed with exit code $exitCode.'));
@ -374,7 +374,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
@override @override
Future<Null> chooseWorkingDevice() async { Future<Null> chooseWorkingDevice() async {
final List<IosDevice> allDevices = (await discoverDevices()) final List<IosDevice> allDevices = (await discoverDevices())
.map((String id) => IosDevice(deviceId: id)) .map<IosDevice>((String id) => IosDevice(deviceId: id))
.toList(); .toList();
if (allDevices.isEmpty) if (allDevices.isEmpty)
@ -387,7 +387,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
@override @override
Future<List<String>> discoverDevices() async { Future<List<String>> discoverDevices() async {
final List<String> iosDeviceIDs = LineSplitter.split(await eval('idevice_id', <String>['-l'])) final List<String> iosDeviceIDs = LineSplitter.split(await eval('idevice_id', <String>['-l']))
.map((String line) => line.trim()) .map<String>((String line) => line.trim())
.where((String line) => line.isNotEmpty) .where((String line) => line.isNotEmpty)
.toList(); .toList();
if (iosDeviceIDs.isEmpty) if (iosDeviceIDs.isEmpty)

View File

@ -83,7 +83,7 @@ Manifest _validateAndParseManifest(Map<dynamic, dynamic> manifestYaml) {
List<ManifestTask> _validateAndParseTasks(dynamic tasksYaml) { List<ManifestTask> _validateAndParseTasks(dynamic tasksYaml) {
_checkType(tasksYaml is Map, tasksYaml, 'Value of "tasks"', 'dictionary'); _checkType(tasksYaml is Map, tasksYaml, 'Value of "tasks"', 'dictionary');
final List<dynamic> sortedKeys = tasksYaml.keys.toList()..sort(); final List<dynamic> sortedKeys = tasksYaml.keys.toList()..sort();
return sortedKeys.map((dynamic taskName) => _validateAndParseTask(taskName, tasksYaml[taskName])).toList(); return sortedKeys.map<ManifestTask>((dynamic taskName) => _validateAndParseTask(taskName, tasksYaml[taskName])).toList();
} }
ManifestTask _validateAndParseTask(dynamic taskName, dynamic taskYaml) { ManifestTask _validateAndParseTask(dynamic taskName, dynamic taskYaml) {

View File

@ -44,8 +44,8 @@ Future<Map<String, dynamic>> runTask(String taskName, { bool silent = false }) a
final Completer<int> port = Completer<int>(); final Completer<int> port = Completer<int>();
final StreamSubscription<String> stdoutSub = runner.stdout final StreamSubscription<String> stdoutSub = runner.stdout
.transform(const Utf8Decoder()) .transform<String>(const Utf8Decoder())
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
if (!port.isCompleted) { if (!port.isCompleted) {
final int portValue = parseServicePort(line, prefix: 'Observatory listening on '); final int portValue = parseServicePort(line, prefix: 'Observatory listening on ');
@ -58,8 +58,8 @@ Future<Map<String, dynamic>> runTask(String taskName, { bool silent = false }) a
}); });
final StreamSubscription<String> stderrSub = runner.stderr final StreamSubscription<String> stderrSub = runner.stderr
.transform(const Utf8Decoder()) .transform<String>(const Utf8Decoder())
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
stderr.writeln('[$taskName] [STDERR] $line'); stderr.writeln('[$taskName] [STDERR] $line');
}); });

View File

@ -172,14 +172,14 @@ Future<String> getCurrentFlutterRepoCommit() {
return null; return null;
} }
return inDirectory(flutterDirectory, () { return inDirectory<String>(flutterDirectory, () {
return eval('git', <String>['rev-parse', 'HEAD']); return eval('git', <String>['rev-parse', 'HEAD']);
}); });
} }
Future<DateTime> getFlutterRepoCommitTimestamp(String commit) { Future<DateTime> getFlutterRepoCommitTimestamp(String commit) {
// git show -s --format=%at 4b546df7f0b3858aaaa56c4079e5be1ba91fbb65 // git show -s --format=%at 4b546df7f0b3858aaaa56c4079e5be1ba91fbb65
return inDirectory(flutterDirectory, () async { return inDirectory<DateTime>(flutterDirectory, () async {
final String unixTimestamp = await eval('git', <String>[ final String unixTimestamp = await eval('git', <String>[
'show', 'show',
'-s', '-s',
@ -235,7 +235,7 @@ Future<Process> startProcess(
final ProcessInfo processInfo = ProcessInfo(command, process); final ProcessInfo processInfo = ProcessInfo(command, process);
_runningProcesses.add(processInfo); _runningProcesses.add(processInfo);
process.exitCode.then((int exitCode) { process.exitCode.then<void>((int exitCode) {
print('"$executable" exit code: $exitCode'); print('"$executable" exit code: $exitCode');
_runningProcesses.remove(processInfo); _runningProcesses.remove(processInfo);
}); });
@ -273,14 +273,14 @@ Future<int> exec(
final Completer<Null> stdoutDone = Completer<Null>(); final Completer<Null> stdoutDone = Completer<Null>();
final Completer<Null> stderrDone = Completer<Null>(); final Completer<Null> stderrDone = Completer<Null>();
process.stdout process.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('stdout: $line'); print('stdout: $line');
}, onDone: () { stdoutDone.complete(); }); }, onDone: () { stdoutDone.complete(); });
process.stderr process.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('stderr: $line'); print('stderr: $line');
}, onDone: () { stderrDone.complete(); }); }, onDone: () { stderrDone.complete(); });
@ -310,15 +310,15 @@ Future<String> eval(
final Completer<Null> stdoutDone = Completer<Null>(); final Completer<Null> stdoutDone = Completer<Null>();
final Completer<Null> stderrDone = Completer<Null>(); final Completer<Null> stderrDone = Completer<Null>();
process.stdout process.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('stdout: $line'); print('stdout: $line');
output.writeln(line); output.writeln(line);
}, onDone: () { stdoutDone.complete(); }); }, onDone: () { stdoutDone.complete(); });
process.stderr process.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('stderr: $line'); print('stderr: $line');
}, onDone: () { stderrDone.complete(); }); }, onDone: () { stderrDone.complete(); });
@ -427,11 +427,11 @@ Future<Null> getFlutter(String revision) async {
flutterDirectory.deleteSync(recursive: true); flutterDirectory.deleteSync(recursive: true);
} }
await inDirectory(flutterDirectory.parent, () async { await inDirectory<void>(flutterDirectory.parent, () async {
await exec('git', <String>['clone', 'https://github.com/flutter/flutter.git']); await exec('git', <String>['clone', 'https://github.com/flutter/flutter.git']);
}); });
await inDirectory(flutterDirectory, () async { await inDirectory<void>(flutterDirectory, () async {
await exec('git', <String>['checkout', revision]); await exec('git', <String>['checkout', revision]);
}); });

View File

@ -22,7 +22,7 @@ const int _kRunsPerBenchmark = 3;
Directory get _megaGalleryDirectory => dir(path.join(Directory.systemTemp.path, 'mega_gallery')); Directory get _megaGalleryDirectory => dir(path.join(Directory.systemTemp.path, 'mega_gallery'));
Future<TaskResult> analyzerBenchmarkTask() async { Future<TaskResult> analyzerBenchmarkTask() async {
await inDirectory(flutterDirectory, () async { await inDirectory<void>(flutterDirectory, () async {
rmTree(_megaGalleryDirectory); rmTree(_megaGalleryDirectory);
mkdirs(_megaGalleryDirectory); mkdirs(_megaGalleryDirectory);
await dart(<String>['dev/tools/mega_gallery.dart', '--out=${_megaGalleryDirectory.path}']); await dart(<String>['dev/tools/mega_gallery.dart', '--out=${_megaGalleryDirectory.path}']);
@ -74,7 +74,7 @@ abstract class _Benchmark {
Future<double> execute(int iteration, int targetIterations) async { Future<double> execute(int iteration, int targetIterations) async {
section('Analyze $title ${watch ? 'with watcher' : ''} - ${iteration + 1} / $targetIterations'); section('Analyze $title ${watch ? 'with watcher' : ''} - ${iteration + 1} / $targetIterations');
final Stopwatch stopwatch = Stopwatch(); final Stopwatch stopwatch = Stopwatch();
await inDirectory(directory, () async { await inDirectory<void>(directory, () async {
stopwatch.start(); stopwatch.start();
await flutter('analyze', options: options); await flutter('analyze', options: options);
stopwatch.stop(); stopwatch.stop();

View File

@ -28,7 +28,7 @@ class GalleryTransitionTest {
final String deviceId = device.deviceId; final String deviceId = device.deviceId;
final Directory galleryDirectory = final Directory galleryDirectory =
dir('${flutterDirectory.path}/examples/flutter_gallery'); dir('${flutterDirectory.path}/examples/flutter_gallery');
await inDirectory(galleryDirectory, () async { await inDirectory<void>(galleryDirectory, () async {
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) if (deviceOperatingSystem == DeviceOperatingSystem.ios)

View File

@ -29,11 +29,11 @@ TaskFunction createHotModeTest() {
int hotReloadCount = 0; int hotReloadCount = 0;
Map<String, dynamic> twoReloadsData; Map<String, dynamic> twoReloadsData;
Map<String, dynamic> freshRestartReloadsData; Map<String, dynamic> freshRestartReloadsData;
await inDirectory(flutterDirectory, () async { await inDirectory<void>(flutterDirectory, () async {
rmTree(_editedFlutterGalleryDir); rmTree(_editedFlutterGalleryDir);
mkdirs(_editedFlutterGalleryDir); mkdirs(_editedFlutterGalleryDir);
recursiveCopy(flutterGalleryDir, _editedFlutterGalleryDir); recursiveCopy(flutterGalleryDir, _editedFlutterGalleryDir);
await inDirectory(_editedFlutterGalleryDir, () async { await inDirectory<void>(_editedFlutterGalleryDir, () async {
if (deviceOperatingSystem == DeviceOperatingSystem.ios) if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(_editedFlutterGalleryDir.path); await prepareProvisioningCertificates(_editedFlutterGalleryDir.path);
{ {
@ -46,8 +46,8 @@ TaskFunction createHotModeTest() {
final Completer<Null> stdoutDone = Completer<Null>(); final Completer<Null> stdoutDone = Completer<Null>();
final Completer<Null> stderrDone = Completer<Null>(); final Completer<Null> stderrDone = Completer<Null>();
process.stdout process.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
if (line.contains('\] Reloaded ')) { if (line.contains('\] Reloaded ')) {
if (hotReloadCount == 0) { if (hotReloadCount == 0) {
@ -72,8 +72,8 @@ TaskFunction createHotModeTest() {
stdoutDone.complete(); stdoutDone.complete();
}); });
process.stderr process.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('stderr: $line'); print('stderr: $line');
}, onDone: () { }, onDone: () {
@ -99,8 +99,8 @@ TaskFunction createHotModeTest() {
final Completer<Null> stdoutDone = Completer<Null>(); final Completer<Null> stdoutDone = Completer<Null>();
final Completer<Null> stderrDone = Completer<Null>(); final Completer<Null> stderrDone = Completer<Null>();
process.stdout process.stdout
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
if (line.contains('\] Reloaded ')) { if (line.contains('\] Reloaded ')) {
process.stdin.writeln('q'); process.stdin.writeln('q');
@ -110,8 +110,8 @@ TaskFunction createHotModeTest() {
stdoutDone.complete(); stdoutDone.complete();
}); });
process.stderr process.stderr
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
print('stderr: $line'); print('stderr: $line');
}, onDone: () { }, onDone: () {

View File

@ -73,7 +73,7 @@ class DriverTest {
final List<String> extraOptions; final List<String> extraOptions;
Future<TaskResult> call() { Future<TaskResult> call() {
return inDirectory(testDirectory, () async { return inDirectory<TaskResult>(testDirectory, () async {
final Device device = await devices.workingDevice; final Device device = await devices.workingDevice;
await device.unlock(); await device.unlock();
final String deviceId = device.deviceId; final String deviceId = device.deviceId;

View File

@ -15,7 +15,7 @@ Future<TaskResult> runEndToEndTests() async {
await device.unlock(); await device.unlock();
final String deviceId = device.deviceId; final String deviceId = device.deviceId;
final Directory testDirectory = dir('${flutterDirectory.path}/dev/integration_tests/ui'); final Directory testDirectory = dir('${flutterDirectory.path}/dev/integration_tests/ui');
await inDirectory(testDirectory, () async { await inDirectory<void>(testDirectory, () async {
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) if (deviceOperatingSystem == DeviceOperatingSystem.ios)

View File

@ -78,8 +78,8 @@ Future<Map<String, double>> _readJsonResults(Process process) {
final Completer<Map<String, double>> completer = Completer<Map<String, double>>(); final Completer<Map<String, double>> completer = Completer<Map<String, double>>();
final StreamSubscription<String> stderrSub = process.stderr final StreamSubscription<String> stderrSub = process.stderr
.transform(const Utf8Decoder()) .transform<String>(const Utf8Decoder())
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
stderr.writeln('[STDERR] $line'); stderr.writeln('[STDERR] $line');
}); });
@ -87,8 +87,8 @@ Future<Map<String, double>> _readJsonResults(Process process) {
bool processWasKilledIntentionally = false; bool processWasKilledIntentionally = false;
bool resultsHaveBeenParsed = false; bool resultsHaveBeenParsed = false;
final StreamSubscription<String> stdoutSub = process.stdout final StreamSubscription<String> stdoutSub = process.stdout
.transform(const Utf8Decoder()) .transform<String>(const Utf8Decoder())
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) async { .listen((String line) async {
print(line); print(line);

View File

@ -75,7 +75,7 @@ TaskFunction createBasicMaterialCompileTest() {
rmTree(sampleDir); rmTree(sampleDir);
await inDirectory(Directory.systemTemp, () async { await inDirectory<void>(Directory.systemTemp, () async {
await flutter('create', options: <String>[sampleAppName]); await flutter('create', options: <String>[sampleAppName]);
}); });
@ -95,7 +95,7 @@ class StartupTest {
final bool reportMetrics; final bool reportMetrics;
Future<TaskResult> run() async { Future<TaskResult> run() async {
return await inDirectory(testDirectory, () async { return await inDirectory<TaskResult>(testDirectory, () async {
final String deviceId = (await devices.workingDevice).deviceId; final String deviceId = (await devices.workingDevice).deviceId;
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
@ -131,7 +131,7 @@ class PerfTest {
final String timelineFileName; final String timelineFileName;
Future<TaskResult> run() { Future<TaskResult> run() {
return inDirectory(testDirectory, () async { return inDirectory<TaskResult>(testDirectory, () async {
final Device device = await devices.workingDevice; final Device device = await devices.workingDevice;
await device.unlock(); await device.unlock();
final String deviceId = device.deviceId; final String deviceId = device.deviceId;
@ -183,7 +183,7 @@ class CompileTest {
final bool reportPackageContentSizes; final bool reportPackageContentSizes;
Future<TaskResult> run() async { Future<TaskResult> run() async {
return await inDirectory(testDirectory, () async { return await inDirectory<TaskResult>(testDirectory, () async {
final Device device = await devices.workingDevice; final Device device = await devices.workingDevice;
await device.unlock(); await device.unlock();
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
@ -402,7 +402,7 @@ class MemoryTest {
Device _device; Device _device;
Future<TaskResult> run() { Future<TaskResult> run() {
return inDirectory(project, () async { return inDirectory<TaskResult>(project, () async {
// This test currently only works on Android, because device.logcat, // This test currently only works on Android, because device.logcat,
// device.getMemoryStats, etc, aren't implemented for iOS. // device.getMemoryStats, etc, aren't implemented for iOS.

View File

@ -18,7 +18,7 @@ Future<TaskResult> samplePageCatalogGenerator(String authorizationToken) async {
final String deviceId = device.deviceId; final String deviceId = device.deviceId;
final Directory catalogDirectory = dir('${flutterDirectory.path}/examples/catalog'); final Directory catalogDirectory = dir('${flutterDirectory.path}/examples/catalog');
await inDirectory(catalogDirectory, () async { await inDirectory<void>(catalogDirectory, () async {
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
final bool isIosDevice = deviceOperatingSystem == DeviceOperatingSystem.ios; final bool isIosDevice = deviceOperatingSystem == DeviceOperatingSystem.ios;

View File

@ -65,7 +65,7 @@ class Upload {
} else { } else {
// TODO(hansmuller): only retry on 5xx and 429 responses // TODO(hansmuller): only retry on 5xx and 429 responses
logMessage('Request to save "$name" (length ${content.length}) failed with status ${response.statusCode}, will retry'); logMessage('Request to save "$name" (length ${content.length}) failed with status ${response.statusCode}, will retry');
logMessage(await response.transform(utf8.decoder).join()); logMessage(await response.transform<String>(utf8.decoder).join());
} }
return response.statusCode == HttpStatus.ok; return response.statusCode == HttpStatus.ok;
} on TimeoutException catch (_) { } on TimeoutException catch (_) {
@ -104,7 +104,7 @@ Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, Li
while (uploads.any(Upload.isNotComplete)) { while (uploads.any(Upload.isNotComplete)) {
final HttpClient client = HttpClient(); final HttpClient client = HttpClient();
uploads = uploads.where(Upload.isNotComplete).toList(); uploads = uploads.where(Upload.isNotComplete).toList();
await Future.wait(uploads.map((Upload upload) => upload.run(client))); await Future.wait<bool>(uploads.map<Future<bool>>((Upload upload) => upload.run(client)));
client.close(force: true); client.close(force: true);
} }
} }

View File

@ -59,7 +59,7 @@ class TestApp extends StatelessWidget {
builder: (BuildContext context) { builder: (BuildContext context) {
return Scaffold( return Scaffold(
body: ListView( body: ListView(
children: routes.map((String value) { children: routes.map<Widget>((String value) {
return MaterialButton( return MaterialButton(
child: Text(value), child: Text(value),
onPressed: () { onPressed: () {

View File

@ -123,7 +123,7 @@ class PlatformViewState extends State<PlatformViewPage> {
final List<dynamic> unTypedRecordedEvents = codec.decodeMessage(data); final List<dynamic> unTypedRecordedEvents = codec.decodeMessage(data);
final List<Map<String, dynamic>> recordedEvents = unTypedRecordedEvents final List<Map<String, dynamic>> recordedEvents = unTypedRecordedEvents
.cast<Map<dynamic, dynamic>>() .cast<Map<dynamic, dynamic>>()
.map((Map<dynamic, dynamic> e) =>e.cast<String, dynamic>()) .map<Map<String, dynamic>>((Map<dynamic, dynamic> e) =>e.cast<String, dynamic>())
.toList(); .toList();
await channel.invokeMethod('pipeFlutterViewEvents'); await channel.invokeMethod('pipeFlutterViewEvents');
await viewChannel.invokeMethod('pipeTouchEvents'); await viewChannel.invokeMethod('pipeTouchEvents');

View File

@ -22,7 +22,7 @@ class IconsList extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView( return ListView(
children: samples.map((IconSample s) => IconSampleRow(s)).toList(), children: samples.map<IconSampleRow>((IconSample s) => IconSampleRow(s)).toList(),
); );
} }
} }

View File

@ -452,7 +452,7 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
appBar: AppBar( appBar: AppBar(
title: const Text('Animation'), title: const Text('Animation'),
bottom: TabBar( bottom: TabBar(
tabs: _allDemos.map((_ArcDemo demo) => Tab(text: demo.title)).toList(), tabs: _allDemos.map<Tab>((_ArcDemo demo) => Tab(text: demo.title)).toList(),
), ),
), ),
floatingActionButton: Builder( floatingActionButton: Builder(
@ -466,7 +466,7 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
}, },
), ),
body: TabBarView( body: TabBarView(
children: _allDemos.map((_ArcDemo demo) => demo.builder(demo)).toList() children: _allDemos.map<Widget>((_ArcDemo demo) => demo.builder(demo)).toList()
) )
) )
); );

View File

@ -119,7 +119,7 @@ class PageViewAppState extends State<PageViewApp> {
Widget _buildBody(BuildContext context) { Widget _buildBody(BuildContext context) {
return PageView( return PageView(
children: cardModels.map(buildCard).toList(), children: cardModels.map<Widget>(buildCard).toList(),
// TODO(abarth): itemsWrap: itemsWrap, // TODO(abarth): itemsWrap: itemsWrap,
scrollDirection: scrollDirection, scrollDirection: scrollDirection,
); );

View File

@ -189,7 +189,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
switch (_random.nextInt(10)) { switch (_random.nextInt(10)) {
case 0: case 0:
if (value == null) if (value == null)
return pickFromList(_random, Colors.primaries)[(_random.nextInt(9) + 1) * 100]; return pickFromList<MaterialColor>(_random, Colors.primaries)[(_random.nextInt(9) + 1) * 100];
switch (_random.nextInt(4)) { switch (_random.nextInt(4)) {
case 0: case 0:
return value.withAlpha(value.alpha + _random.nextInt(10) - 5); return value.withAlpha(value.alpha + _random.nextInt(10) - 5);
@ -240,7 +240,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
case 0: case 0:
return null; return null;
case 1: case 1:
return pickFromList(_random, TextDecorationStyle.values); return pickFromList<TextDecorationStyle>(_random, TextDecorationStyle.values);
} }
return value; return value;
} }
@ -250,7 +250,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
case 0: case 0:
return null; return null;
case 1: case 1:
return pickFromList(_random, FontWeight.values); return pickFromList<FontWeight>(_random, FontWeight.values);
} }
return value; return value;
} }
@ -260,7 +260,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
case 0: case 0:
return null; return null;
case 1: case 1:
return pickFromList(_random, FontStyle.values); return pickFromList<FontStyle>(_random, FontStyle.values);
} }
return value; return value;
} }
@ -938,7 +938,7 @@ class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin
if (mounted && intrinsicKey.currentContext.size.height != controlKey.currentContext.size.height) { if (mounted && intrinsicKey.currentContext.size.height != controlKey.currentContext.size.height) {
debugPrint('Found some text that unexpectedly renders at different heights.'); debugPrint('Found some text that unexpectedly renders at different heights.');
debugPrint('Text: $_text'); debugPrint('Text: $_text');
debugPrint(_text.runes.map((int index) => 'U+' + index.toRadixString(16).padLeft(4, '0')).join(' ')); debugPrint(_text.runes.map<String>((int index) => 'U+' + index.toRadixString(16).padLeft(4, '0')).join(' '));
setState(() { setState(() {
_ticker.stop(); _ticker.stop();
}); });
@ -1045,7 +1045,7 @@ class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin
FlatButton( FlatButton(
onPressed: _ticker.isActive ? null : () { onPressed: _ticker.isActive ? null : () {
print('The currently visible text is: $_text'); print('The currently visible text is: $_text');
print(_text.runes.map((int value) => 'U+${value.toRadixString(16).padLeft(4, '0').toUpperCase()}').join(' ')); print(_text.runes.map<String>((int value) => 'U+${value.toRadixString(16).padLeft(4, '0').toUpperCase()}').join(' '));
}, },
child: const Text('DUMP TEXT TO LOGS'), child: const Text('DUMP TEXT TO LOGS'),
), ),
@ -2109,7 +2109,7 @@ int randomCharacter(math.Random random) {
Range(0x2ceb0, 0x2ebe0), Range(0x2ceb0, 0x2ebe0),
Range(0x2f800, 0x2fa1d), Range(0x2f800, 0x2fa1d),
]; ];
final Range range = pickFromList(random, characterRanges); final Range range = pickFromList<Range>(random, characterRanges);
if (range.start == range.end) if (range.start == range.end)
return range.start; return range.start;
return range.start + random.nextInt(range.end - range.start); return range.start + random.nextInt(range.end - range.start);

View File

@ -12,7 +12,7 @@ import 'mock_image_http.dart';
void main() { void main() {
testWidgets('Card Collection smoke test', (WidgetTester tester) async { testWidgets('Card Collection smoke test', (WidgetTester tester) async {
HttpOverrides.runZoned(() async { HttpOverrides.runZoned<Future<void>>(() async {
card_collection.main(); // builds the app and schedules a frame but doesn't trigger one card_collection.main(); // builds the app and schedules a frame but doesn't trigger one
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865 await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
await tester.pump(); // triggers a frame await tester.pump(); // triggers a frame

View File

@ -12,7 +12,7 @@ import 'mock_image_http.dart';
void main() { void main() {
testWidgets('Color testing demo smoke test', (WidgetTester tester) async { testWidgets('Color testing demo smoke test', (WidgetTester tester) async {
HttpOverrides.runZoned(() async { HttpOverrides.runZoned<Future<void>>(() async {
color_testing_demo.main(); // builds the app and schedules a frame but doesn't trigger one color_testing_demo.main(); // builds the app and schedules a frame but doesn't trigger one
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865 await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
await tester.pump(); // triggers a frame await tester.pump(); // triggers a frame

View File

@ -146,7 +146,7 @@ Future<Null> main(List<String> arguments) async {
} }
String quote(String arg) => arg.contains(' ') ? "'$arg'" : arg; String quote(String arg) => arg.contains(' ') ? "'$arg'" : arg;
print('Executing: (cd dev/docs ; $pubExecutable ${dartdocArgs.map(quote).join(' ')})'); print('Executing: (cd dev/docs ; $pubExecutable ${dartdocArgs.map<String>(quote).join(' ')})');
process = await Process.start( process = await Process.start(
pubExecutable, pubExecutable,
@ -302,7 +302,7 @@ void putRedirectInOldIndexLocation() {
} }
List<String> findPackageNames() { List<String> findPackageNames() {
return findPackages().map((FileSystemEntity file) => path.basename(file.path)).toList(); return findPackages().map<String>((FileSystemEntity file) => path.basename(file.path)).toList();
} }
/// Finds all packages in the Flutter SDK /// Finds all packages in the Flutter SDK
@ -350,8 +350,8 @@ void printStream(Stream<List<int>> stream, { String prefix = '', List<Pattern> f
assert(prefix != null); assert(prefix != null);
assert(filter != null); assert(filter != null);
stream stream
.transform(utf8.decoder) .transform<String>(utf8.decoder)
.transform(const LineSplitter()) .transform<String>(const LineSplitter())
.listen((String line) { .listen((String line) {
if (!filter.any((Pattern pattern) => line.contains(pattern))) if (!filter.any((Pattern pattern) => line.contains(pattern)))
print('$prefix$line'.trim()); print('$prefix$line'.trim());

View File

@ -135,7 +135,7 @@ String _jsonToMap(dynamic json) {
} }
if (json is Iterable) if (json is Iterable)
return '<dynamic>[${json.map(_jsonToMap).join(',')}]'; return '<dynamic>[${json.map<String>(_jsonToMap).join(',')}]';
if (json is Map<String, dynamic>) { if (json is Map<String, dynamic>) {
final StringBuffer buffer = StringBuffer('<String, dynamic>{'); final StringBuffer buffer = StringBuffer('<String, dynamic>{');

View File

@ -202,7 +202,7 @@ String generateTranslationBundles() {
/// ///
/// * [getTranslation], whose documentation describes these values. /// * [getTranslation], whose documentation describes these values.
final Set<String> kSupportedLanguages = HashSet<String>.from(const <String>[ final Set<String> kSupportedLanguages = HashSet<String>.from(const <String>[
${languageCodes.map((String value) => " '$value', // ${describeLocale(value)}").toList().join('\n')} ${languageCodes.map<String>((String value) => " '$value', // ${describeLocale(value)}").toList().join('\n')}
]); ]);
/// Creates a [GlobalMaterialLocalizations] instance for the given `locale`. /// Creates a [GlobalMaterialLocalizations] instance for the given `locale`.

View File

@ -105,7 +105,7 @@ void main(List<String> args) {
exit(1); exit(1);
} }
final List<int> parts = match.groups(<int>[1, 2, 3]).map(int.parse).toList(); final List<int> parts = match.groups(<int>[1, 2, 3]).map<int>(int.parse).toList();
if (match.group(4) == '0') { if (match.group(4) == '0') {
print('This commit has already been released, as version ${parts.join(".")}.'); print('This commit has already been released, as version ${parts.join(".")}.');

View File

@ -29,7 +29,7 @@ void checkCwdIsRepoRoot(String commandName) {
String camelCase(String locale) { String camelCase(String locale) {
return locale return locale
.split('_') .split('_')
.map((String part) => part.substring(0, 1).toUpperCase() + part.substring(1).toLowerCase()) .map<String>((String part) => part.substring(0, 1).toUpperCase() + part.substring(1).toLowerCase())
.join(''); .join('');
} }
@ -91,7 +91,7 @@ Future<void> precacheLanguageAndRegionTags() async {
final HttpClient client = HttpClient(); final HttpClient client = HttpClient();
final HttpClientRequest request = await client.getUrl(Uri.parse(registry)); final HttpClientRequest request = await client.getUrl(Uri.parse(registry));
final HttpClientResponse response = await request.close(); final HttpClientResponse response = await request.close();
final String body = (await response.transform(utf8.decoder).toList()).join(''); final String body = (await response.transform<String>(utf8.decoder).toList()).join('');
client.close(force: true); client.close(force: true);
final List<Map<String, List<String>>> sections = body.split('%%').skip(1).map<Map<String, List<String>>>(_parseSection).toList(); final List<Map<String, List<String>>> sections = body.split('%%').skip(1).map<Map<String, List<String>>>(_parseSection).toList();
for (Map<String, List<String>> section in sections) { for (Map<String, List<String>> section in sections) {

View File

@ -199,9 +199,9 @@ String regenerateIconsFile(String iconData, String codepointData) {
String generateIconDeclarations(String codepointData) { String generateIconDeclarations(String codepointData) {
return LineSplitter.split(codepointData) return LineSplitter.split(codepointData)
.map((String l) => l.trim()) .map<String>((String l) => l.trim())
.where((String l) => l.isNotEmpty) .where((String l) => l.isNotEmpty)
.map(getIconDeclaration) .map<String>(getIconDeclaration)
.join(); .join();
} }

View File

@ -314,7 +314,7 @@ class SvgPath {
SvgPath applyTransform(_Transform transform) { SvgPath applyTransform(_Transform transform) {
final List<SvgPathCommand> transformedCommands = final List<SvgPathCommand> transformedCommands =
commands.map((SvgPathCommand c) => c.applyTransform(transform)).toList(); commands.map<SvgPathCommand>((SvgPathCommand c) => c.applyTransform(transform)).toList();
return SvgPath(id, transformedCommands, opacity: opacity * transform.opacity); return SvgPath(id, transformedCommands, opacity: opacity * transform.opacity);
} }
@ -400,7 +400,7 @@ class SvgPathCommandBuilder {
SvgPathCommand build(String type, List<Point<double>> points) { SvgPathCommand build(String type, List<Point<double>> points) {
List<Point<double>> absPoints = points; List<Point<double>> absPoints = points;
if (_isRelativeCommand(type)) { if (_isRelativeCommand(type)) {
absPoints = points.map((Point<double> p) => p + lastPoint).toList(); absPoints = points.map<Point<double>>((Point<double> p) => p + lastPoint).toList();
} }
if (type == 'M' || type == 'm') if (type == 'M' || type == 'm')

View File

@ -89,7 +89,7 @@ class SampleInfo {
final String classNames = commentValues['classes']; final String classNames = commentValues['classes'];
if (classNames == null) if (classNames == null)
return const <String>[]; return const <String>[];
return classNames.split(',').map((String s) => s.trim()).where((String s) => s.isNotEmpty); return classNames.split(',').map<String>((String s) => s.trim()).where((String s) => s.isNotEmpty);
} }
// The relative import path for this sample, like '../lib/foo.dart'. // The relative import path for this sample, like '../lib/foo.dart'.
@ -163,7 +163,7 @@ void generate(String commit) {
final String entryTemplate = inputFile('bin', 'entry.md.template').readAsStringSync(); final String entryTemplate = inputFile('bin', 'entry.md.template').readAsStringSync();
// Write the sample catalog's home page: index.md // Write the sample catalog's home page: index.md
final Iterable<String> entries = samples.map((SampleInfo sample) { final Iterable<String> entries = samples.map<String>((SampleInfo sample) {
return expandTemplate(entryTemplate, sample.commentValues); return expandTemplate(entryTemplate, sample.commentValues);
}); });
writeExpandedTemplate( writeExpandedTemplate(
@ -195,7 +195,7 @@ void generate(String commit) {
} }
} }
for (String className in classToSamples.keys) { for (String className in classToSamples.keys) {
final Iterable<String> entries = classToSamples[className].map((SampleInfo sample) { final Iterable<String> entries = classToSamples[className].map<String>((SampleInfo sample) {
return expandTemplate(entryTemplate, sample.commentValues); return expandTemplate(entryTemplate, sample.commentValues);
}); });
writeExpandedTemplate( writeExpandedTemplate(
@ -215,10 +215,10 @@ void generate(String commit) {
outputFile('screenshot.dart', driverDirectory), outputFile('screenshot.dart', driverDirectory),
inputFile('bin', 'screenshot.dart.template').readAsStringSync(), inputFile('bin', 'screenshot.dart.template').readAsStringSync(),
<String, String>{ <String, String>{
'imports': samples.map((SampleInfo page) { 'imports': samples.map<String>((SampleInfo page) {
return "import '${page.importPath}' show ${page.sampleClass};\n"; return "import '${page.importPath}' show ${page.sampleClass};\n";
}).toList().join(), }).toList().join(),
'widgets': samples.map((SampleInfo sample) { 'widgets': samples.map<String>((SampleInfo sample) {
return 'new ${sample.sampleClass}(),\n'; return 'new ${sample.sampleClass}(),\n';
}).toList().join(), }).toList().join(),
}, },
@ -230,7 +230,7 @@ void generate(String commit) {
outputFile('screenshot_test.dart', driverDirectory), outputFile('screenshot_test.dart', driverDirectory),
inputFile('bin', 'screenshot_test.dart.template').readAsStringSync(), inputFile('bin', 'screenshot_test.dart.template').readAsStringSync(),
<String, String>{ <String, String>{
'paths': samples.map((SampleInfo sample) { 'paths': samples.map<String>((SampleInfo sample) {
return "'${outputFile(sample.sourceName + '.png').path}'"; return "'${outputFile(sample.sourceName + '.png').path}'";
}).toList().join(',\n'), }).toList().join(',\n'),
}, },

View File

@ -63,7 +63,7 @@ class _AppBarBottomSampleState extends State<AppBarBottomSample> with SingleTick
), ),
body: TabBarView( body: TabBarView(
controller: _tabController, controller: _tabController,
children: choices.map((Choice choice) { children: choices.map<Widget>((Choice choice) {
return Padding( return Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: ChoiceCard(choice: choice), child: ChoiceCard(choice: choice),

View File

@ -37,7 +37,7 @@ class _BasicAppBarSampleState extends State<BasicAppBarSample> {
PopupMenuButton<Choice>( // overflow menu PopupMenuButton<Choice>( // overflow menu
onSelected: _select, onSelected: _select,
itemBuilder: (BuildContext context) { itemBuilder: (BuildContext context) {
return choices.skip(2).map((Choice choice) { return choices.skip(2).map<PopupMenuItem<Choice>>((Choice choice) {
return PopupMenuItem<Choice>( return PopupMenuItem<Choice>(
value: choice, value: choice,
child: Text(choice.title), child: Text(choice.title),

View File

@ -50,7 +50,7 @@ class AdjustableDropdownListTile extends StatelessWidget {
trailing: DropdownButton<String>( trailing: DropdownButton<String>(
value: value, value: value,
onChanged: onChanged, onChanged: onChanged,
items: items.map((String item) { items: items.map<DropdownMenuItem<String>>((String item) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: item, value: item,
child: Text(item), child: Text(item),

View File

@ -78,7 +78,7 @@ class EntryItem extends StatelessWidget {
return ExpansionTile( return ExpansionTile(
key: PageStorageKey<Entry>(root), key: PageStorageKey<Entry>(root),
title: Text(root.title), title: Text(root.title),
children: root.children.map(_buildTiles).toList(), children: root.children.map<Widget>(_buildTiles).toList(),
); );
} }

View File

@ -15,7 +15,7 @@ class TabbedAppBarSample extends StatelessWidget {
title: const Text('Tabbed AppBar'), title: const Text('Tabbed AppBar'),
bottom: TabBar( bottom: TabBar(
isScrollable: true, isScrollable: true,
tabs: choices.map((Choice choice) { tabs: choices.map<Widget>((Choice choice) {
return Tab( return Tab(
text: choice.title, text: choice.title,
icon: Icon(choice.icon), icon: Icon(choice.icon),
@ -24,7 +24,7 @@ class TabbedAppBarSample extends StatelessWidget {
), ),
), ),
body: TabBarView( body: TabBarView(
children: choices.map((Choice choice) { children: choices.map<Widget>((Choice choice) {
return Padding( return Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: ChoiceCard(choice: choice), child: ChoiceCard(choice: choice),

View File

@ -493,7 +493,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
} }
Iterable<Widget> _detailItemsFor(Section section) { Iterable<Widget> _detailItemsFor(Section section) {
final Iterable<Widget> detailItems = section.details.map((SectionDetail detail) { final Iterable<Widget> detailItems = section.details.map<Widget>((SectionDetail detail) {
return SectionDetailView(detail: detail); return SectionDetailView(detail: detail);
}); });
return ListTile.divideTiles(context: context, tiles: detailItems); return ListTile.divideTiles(context: context, tiles: detailItems);
@ -591,7 +591,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
}, },
child: PageView( child: PageView(
controller: _detailsPageController, controller: _detailsPageController,
children: allSections.map((Section section) { children: allSections.map<Widget>((Section section) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: _detailItemsFor(section).toList(), children: _detailItemsFor(section).toList(),

View File

@ -99,7 +99,7 @@ class PaletteTabView extends StatelessWidget {
final TextTheme textTheme = Theme.of(context).textTheme; final TextTheme textTheme = Theme.of(context).textTheme;
final TextStyle whiteTextStyle = textTheme.body1.copyWith(color: Colors.white); final TextStyle whiteTextStyle = textTheme.body1.copyWith(color: Colors.white);
final TextStyle blackTextStyle = textTheme.body1.copyWith(color: Colors.black); final TextStyle blackTextStyle = textTheme.body1.copyWith(color: Colors.black);
final List<Widget> colorItems = primaryKeys.map((int index) { final List<Widget> colorItems = primaryKeys.map<Widget>((int index) {
return DefaultTextStyle( return DefaultTextStyle(
style: index > colors.threshold ? whiteTextStyle : blackTextStyle, style: index > colors.threshold ? whiteTextStyle : blackTextStyle,
child: ColorItem(index: index, color: colors.primary[index]), child: ColorItem(index: index, color: colors.primary[index]),
@ -107,7 +107,7 @@ class PaletteTabView extends StatelessWidget {
}).toList(); }).toList();
if (colors.accent != null) { if (colors.accent != null) {
colorItems.addAll(accentKeys.map((int index) { colorItems.addAll(accentKeys.map<Widget>((int index) {
return DefaultTextStyle( return DefaultTextStyle(
style: index > colors.threshold ? whiteTextStyle : blackTextStyle, style: index > colors.threshold ? whiteTextStyle : blackTextStyle,
child: ColorItem(index: index, color: colors.accent[index], prefix: 'A'), child: ColorItem(index: index, color: colors.accent[index], prefix: 'A'),
@ -135,11 +135,11 @@ class ColorsDemo extends StatelessWidget {
title: const Text('Colors'), title: const Text('Colors'),
bottom: TabBar( bottom: TabBar(
isScrollable: true, isScrollable: true,
tabs: allPalettes.map((Palette swatch) => Tab(text: swatch.name)).toList(), tabs: allPalettes.map<Widget>((Palette swatch) => Tab(text: swatch.name)).toList(),
), ),
), ),
body: TabBarView( body: TabBarView(
children: allPalettes.map((Palette colors) { children: allPalettes.map<Widget>((Palette colors) {
return PaletteTabView(colors: colors); return PaletteTabView(colors: colors);
}).toList(), }).toList(),
), ),

View File

@ -54,7 +54,7 @@ class _ContactItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
final List<Widget> columnChildren = lines.sublist(0, lines.length - 1).map((String line) => Text(line)).toList(); final List<Widget> columnChildren = lines.sublist(0, lines.length - 1).map<Widget>((String line) => Text(line)).toList();
columnChildren.add(Text(lines.last, style: themeData.textTheme.caption)); columnChildren.add(Text(lines.last, style: themeData.textTheme.caption));
final List<Widget> rowChildren = <Widget>[ final List<Widget> rowChildren = <Widget>[

View File

@ -58,7 +58,7 @@ class _CupertinoRefreshControlDemoState extends State<CupertinoRefreshControlDem
CupertinoSliverRefreshControl( CupertinoSliverRefreshControl(
onRefresh: () { onRefresh: () {
return Future<void>.delayed(const Duration(seconds: 2)) return Future<void>.delayed(const Duration(seconds: 2))
..then((_) { ..then<void>((_) {
if (mounted) { if (mounted) {
setState(() => repopulateList()); setState(() => repopulateList());
} }

View File

@ -281,7 +281,7 @@ class _ColorsItem extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: colors.map((_NamedColor namedColor) { children: colors.map<Widget>((_NamedColor namedColor) {
return RawMaterialButton( return RawMaterialButton(
onPressed: () { onPressed: () {
onChanged(namedColor.color); onChanged(namedColor.color);

View File

@ -194,7 +194,7 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
Widget build(BuildContext context) { Widget build(BuildContext context) {
final BottomNavigationBar botNavBar = BottomNavigationBar( final BottomNavigationBar botNavBar = BottomNavigationBar(
items: _navigationViews items: _navigationViews
.map((NavigationIconView navigationView) => navigationView.item) .map<BottomNavigationBarItem>((NavigationIconView navigationView) => navigationView.item)
.toList(), .toList(),
currentIndex: _currentIndex, currentIndex: _currentIndex,
type: _type, type: _type,

View File

@ -280,7 +280,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
dropdown1Value = newValue; dropdown1Value = newValue;
}); });
}, },
items: <String>['One', 'Two', 'Free', 'Four'].map((String value) { items: <String>['One', 'Two', 'Free', 'Four'].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value), child: Text(value),
@ -301,7 +301,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
dropdown2Value = newValue; dropdown2Value = newValue;
}); });
}, },
items: <String>['One', 'Two', 'Free', 'Four'].map((String value) { items: <String>['One', 'Two', 'Free', 'Four'].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value), child: Text(value),
@ -325,7 +325,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
'One', 'Two', 'Free', 'Four', 'Can', 'I', 'Have', 'A', 'Little', 'One', 'Two', 'Free', 'Four', 'Can', 'I', 'Have', 'A', 'Little',
'Bit', 'More', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten' 'Bit', 'More', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'
] ]
.map((String value) { .map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value), child: Text(value),
@ -365,7 +365,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
onPressed: null, onPressed: null,
) )
] ]
.map((Widget button) => SizedBox(width: 64.0, height: 64.0, child: button)) .map<Widget>((Widget button) => SizedBox(width: 64.0, height: 64.0, child: button))
.toList(), .toList(),
), ),
); );

View File

@ -191,7 +191,7 @@ class _CardsDemoState extends State<CardsDemo> {
body: ListView( body: ListView(
itemExtent: TravelDestinationItem.height, itemExtent: TravelDestinationItem.height,
padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
children: destinations.map((TravelDestination destination) { children: destinations.map<Widget>((TravelDestination destination) {
return Container( return Container(
margin: const EdgeInsets.only(bottom: 8.0), margin: const EdgeInsets.only(bottom: 8.0),
child: TravelDestinationItem( child: TravelDestinationItem(

View File

@ -92,7 +92,7 @@ class _ChipsTile extends StatelessWidget {
]; ];
if (children.isNotEmpty) { if (children.isNotEmpty) {
cardChildren.add(Wrap( cardChildren.add(Wrap(
children: children.map((Widget chip) { children: children.map<Widget>((Widget chip) {
return Padding( return Padding(
padding: const EdgeInsets.all(2.0), padding: const EdgeInsets.all(2.0),
child: chip, child: chip,

View File

@ -201,7 +201,7 @@ class _DateAndTimePickerDemoState extends State<DateAndTimePickerDemo> {
_activity = newValue; _activity = newValue;
}); });
}, },
items: _allActivities.map((String value) { items: _allActivities.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value), child: Text(value),

View File

@ -201,7 +201,7 @@ class DialogDemoState extends State<DialogDemo> {
), ),
] ]
// Add a little space between the buttons // Add a little space between the buttons
.map((Widget button) { .map<Widget>((Widget button) {
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: button child: button

View File

@ -159,7 +159,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: _drawerContents.map((String id) { children: _drawerContents.map<Widget>((String id) {
return ListTile( return ListTile(
leading: CircleAvatar(child: Text(id)), leading: CircleAvatar(child: Text(id)),
title: Text('Drawer item $id'), title: Text('Drawer item $id'),

View File

@ -25,7 +25,7 @@ class _ElevationDemoState extends State<ElevationDemo> {
24.0, 24.0,
]; ];
return elevations.map((double elevation) { return elevations.map<Widget>((double elevation) {
return Center( return Center(
child: Card( child: Card(
margin: const EdgeInsets.all(20.0), margin: const EdgeInsets.all(20.0),

View File

@ -356,7 +356,7 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
_demoItems[index].isExpanded = !isExpanded; _demoItems[index].isExpanded = !isExpanded;
}); });
}, },
children: _demoItems.map((DemoItem<dynamic> item) { children: _demoItems.map<ExpansionPanel>((DemoItem<dynamic> item) {
return ExpansionPanel( return ExpansionPanel(
isExpanded: item.isExpanded, isExpanded: item.isExpanded,
headerBuilder: item.headerBuilder, headerBuilder: item.headerBuilder,

View File

@ -251,7 +251,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
) )
) )
] ]
.map((Widget child) { .map<Widget>((Widget child) {
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
height: 96.0, height: 96.0,

View File

@ -374,7 +374,7 @@ class GridListDemoState extends State<GridListDemo> {
crossAxisSpacing: 4.0, crossAxisSpacing: 4.0,
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
childAspectRatio: (orientation == Orientation.portrait) ? 1.0 : 1.3, childAspectRatio: (orientation == Orientation.portrait) ? 1.0 : 1.3,
children: photos.map((Photo photo) { children: photos.map<Widget>((Photo photo) {
return GridDemoPhotoItem( return GridDemoPhotoItem(
photo: photo, photo: photo,
tileStyle: _tileStyle, tileStyle: _tileStyle,

View File

@ -126,7 +126,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
); );
} else { } else {
body = ListView( body = ListView(
children: leaveBehindItems.map((LeaveBehindItem item) { children: leaveBehindItems.map<Widget>((LeaveBehindItem item) {
return _LeaveBehindListItem( return _LeaveBehindListItem(
item: item, item: item,
onArchive: _handleArchive, onArchive: _handleArchive,

View File

@ -209,7 +209,7 @@ class _ListDemoState extends State<ListDemo> {
break; break;
} }
Iterable<Widget> listTiles = items.map((String item) => buildListTile(context, item)); Iterable<Widget> listTiles = items.map<Widget>((String item) => buildListTile(context, item));
if (_showDividers) if (_showDividers)
listTiles = ListTile.divideTiles(context: context, tiles: listTiles); listTiles = ListTile.divideTiles(context: context, tiles: listTiles);

View File

@ -29,7 +29,7 @@ class OverscrollDemoState extends State<OverscrollDemo> {
Future<Null> _handleRefresh() { Future<Null> _handleRefresh() {
final Completer<Null> completer = Completer<Null>(); final Completer<Null> completer = Completer<Null>();
Timer(const Duration(seconds: 3), () { completer.complete(null); }); Timer(const Duration(seconds: 3), () { completer.complete(null); });
return completer.future.then((_) { return completer.future.then<Null>((_) {
_scaffoldKey.currentState?.showSnackBar(SnackBar( _scaffoldKey.currentState?.showSnackBar(SnackBar(
content: const Text('Refresh complete'), content: const Text('Refresh complete'),
action: SnackBarAction( action: SnackBarAction(

View File

@ -54,7 +54,7 @@ class _PageSelector extends StatelessWidget {
color: color, color: color,
), ),
child: TabBarView( child: TabBarView(
children: icons.map((Icon icon) { children: icons.map<Widget>((Icon icon) {
return Container( return Container(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: Card( child: Card(

View File

@ -94,7 +94,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
]; ];
return Column( return Column(
children: indicators children: indicators
.map((Widget c) => Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0))) .map<Widget>((Widget c) => Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0)))
.toList(), .toList(),
); );
} }

View File

@ -44,7 +44,7 @@ class _ListDemoState extends State<ReorderableListDemo> {
bool _reverseSort = false; bool _reverseSort = false;
final List<_ListItem> _items = <String>[ final List<_ListItem> _items = <String>[
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
].map((String item) => _ListItem(item, false)).toList(); ].map<_ListItem>((String item) => _ListItem(item, false)).toList();
void changeItemType(_ReorderableListType type) { void changeItemType(_ReorderableListType type) {
setState(() { setState(() {
@ -191,7 +191,7 @@ class _ListDemoState extends State<ReorderableListDemo> {
onReorder: _onReorder, onReorder: _onReorder,
scrollDirection: _itemType == _ReorderableListType.horizontalAvatar ? Axis.horizontal : Axis.vertical, scrollDirection: _itemType == _ReorderableListType.horizontalAvatar ? Axis.horizontal : Axis.vertical,
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
children: _items.map(buildListTile).toList(), children: _items.map<Widget>(buildListTile).toList(),
), ),
), ),
); );

View File

@ -174,7 +174,7 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
), ),
body: TabBarView( body: TabBarView(
controller: _controller, controller: _controller,
children: _allPages.map((_Page page) { children: _allPages.map<Widget>((_Page page) {
return SafeArea( return SafeArea(
top: false, top: false,
bottom: false, bottom: false,

View File

@ -160,7 +160,7 @@ class _SearchDemoSearchDelegate extends SearchDelegate<int> {
return _SuggestionList( return _SuggestionList(
query: query, query: query,
suggestions: suggestions.map((int i) => '$i').toList(), suggestions: suggestions.map<String>((int i) => '$i').toList(),
onSelected: (String suggestion) { onSelected: (String suggestion) {
query = suggestion; query = suggestion;
showResults(context); showResults(context);

View File

@ -60,7 +60,7 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
), ),
const Text(_text3), const Text(_text3),
] ]
.map((Widget child) { .map<Widget>((Widget child) {
return Container( return Container(
margin: const EdgeInsets.symmetric(vertical: 12.0), margin: const EdgeInsets.symmetric(vertical: 12.0),
child: child child: child

View File

@ -157,7 +157,7 @@ class TabsDemo extends StatelessWidget {
expandedHeight: 150.0, expandedHeight: 150.0,
forceElevated: innerBoxIsScrolled, forceElevated: innerBoxIsScrolled,
bottom: TabBar( bottom: TabBar(
tabs: _allPages.keys.map( tabs: _allPages.keys.map<Widget>(
(_Page page) => Tab(text: page.label), (_Page page) => Tab(text: page.label),
).toList(), ).toList(),
), ),
@ -166,7 +166,7 @@ class TabsDemo extends StatelessWidget {
]; ];
}, },
body: TabBarView( body: TabBarView(
children: _allPages.keys.map((_Page page) { children: _allPages.keys.map<Widget>((_Page page) {
return SafeArea( return SafeArea(
top: false, top: false,
bottom: false, bottom: false,

View File

@ -136,7 +136,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
title: const Text('FAB per tab'), title: const Text('FAB per tab'),
bottom: TabBar( bottom: TabBar(
controller: _controller, controller: _controller,
tabs: _allPages.map((_Page page) => Tab(text: page.label.toUpperCase())).toList(), tabs: _allPages.map<Widget>((_Page page) => Tab(text: page.label.toUpperCase())).toList(),
), ),
actions: <Widget>[ actions: <Widget>[
MaterialDemoDocumentationButton(TabsFabDemo.routeName), MaterialDemoDocumentationButton(TabsFabDemo.routeName),
@ -153,7 +153,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
floatingActionButton: buildFloatingActionButton(_selectedPage), floatingActionButton: buildFloatingActionButton(_selectedPage),
body: TabBarView( body: TabBarView(
controller: _controller, controller: _controller,
children: _allPages.map(buildTabView).toList() children: _allPages.map<Widget>(buildTabView).toList()
), ),
); );
} }

View File

@ -59,7 +59,7 @@ class TooltipDemo extends StatelessWidget {
) )
) )
] ]
.map((Widget widget) { .map<Widget>((Widget widget) {
return Padding( return Padding(
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0), padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: widget child: widget

View File

@ -492,7 +492,7 @@ class RecipeSheet extends StatelessWidget {
), ),
] ]
), ),
]..addAll(recipe.ingredients.map( ]..addAll(recipe.ingredients.map<TableRow>(
(RecipeIngredient ingredient) { (RecipeIngredient ingredient) {
return _buildItemRow(ingredient.amount, ingredient.description); return _buildItemRow(ingredient.amount, ingredient.description);
} }
@ -506,7 +506,7 @@ class RecipeSheet extends StatelessWidget {
), ),
] ]
) )
)..addAll(recipe.steps.map( )..addAll(recipe.steps.map<TableRow>(
(RecipeStep step) { (RecipeStep step) {
return _buildItemRow(step.duration ?? '', step.description); return _buildItemRow(step.duration ?? '', step.description);
} }

View File

@ -395,7 +395,7 @@ class _ShrineHomeState extends State<ShrineHome> {
sliver: SliverGrid( sliver: SliverGrid(
gridDelegate: gridDelegate, gridDelegate: gridDelegate,
delegate: SliverChildListDelegate( delegate: SliverChildListDelegate(
_products.map((Product product) { _products.map<Widget>((Product product) {
return _ProductItem( return _ProductItem(
product: product, product: product,
onPressed: () { _showOrderPage(product); }, onPressed: () { _showOrderPage(product); },

View File

@ -46,7 +46,7 @@ class _ProductItem extends StatelessWidget {
), ),
), ),
child: DropdownButton<int>( child: DropdownButton<int>(
items: <int>[0, 1, 2, 3, 4, 5].map((int value) { items: <int>[0, 1, 2, 3, 4, 5].map<DropdownMenuItem<int>>((int value) {
return DropdownMenuItem<int>( return DropdownMenuItem<int>(
value: value, value: value,
child: Padding( child: Padding(

View File

@ -381,7 +381,7 @@ class _VideoDemoState extends State<VideoDemo>
initController(butterflyController); initController(butterflyController);
initController(beeController); initController(beeController);
isIOSSimulator().then((bool result) { isIOSSimulator().then<void>((bool result) {
isSupported = !result; isSupported = !result;
}); });
} }

View File

@ -96,11 +96,11 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
), ),
bottom: TabBar( bottom: TabBar(
isScrollable: true, isScrollable: true,
tabs: demos.map((ComponentDemoTabData data) => Tab(text: data.tabName)).toList(), tabs: demos.map<Widget>((ComponentDemoTabData data) => Tab(text: data.tabName)).toList(),
), ),
), ),
body: TabBarView( body: TabBarView(
children: demos.map((ComponentDemoTabData demo) { children: demos.map<Widget>((ComponentDemoTabData demo) {
return SafeArea( return SafeArea(
top: false, top: false,
bottom: false, bottom: false,

View File

@ -104,7 +104,7 @@ DropdownButton<String>(
}); });
}, },
items: <String>['One', 'Two', 'Free', 'Four'] items: <String>['One', 'Two', 'Free', 'Four']
.map((String value) { .map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value)); child: Text(value));
@ -263,7 +263,7 @@ GridView.count(
'https://example.com/image-2.jpg', 'https://example.com/image-2.jpg',
'...', '...',
'https://example.com/image-n.jpg' 'https://example.com/image-n.jpg'
].map((String url) { ].map<Widget>((String url) {
return GridTile( return GridTile(
footer: GridTileBar( footer: GridTileBar(
title: Text(url) title: Text(url)

View File

@ -252,7 +252,7 @@ class _TextScaleFactorItem extends StatelessWidget {
padding: const EdgeInsetsDirectional.only(end: 16.0), padding: const EdgeInsetsDirectional.only(end: 16.0),
icon: const Icon(Icons.arrow_drop_down), icon: const Icon(Icons.arrow_drop_down),
itemBuilder: (BuildContext context) { itemBuilder: (BuildContext context) {
return kAllGalleryTextScaleValues.map((GalleryTextScaleValue scaleValue) { return kAllGalleryTextScaleValues.map<PopupMenuItem<GalleryTextScaleValue>>((GalleryTextScaleValue scaleValue) {
return PopupMenuItem<GalleryTextScaleValue>( return PopupMenuItem<GalleryTextScaleValue>(
value: scaleValue, value: scaleValue,
child: Text(scaleValue.label), child: Text(scaleValue.label),

View File

@ -141,7 +141,7 @@ class CalculationManager {
final CalculationMessage message = CalculationMessage(data, _receivePort.sendPort); final CalculationMessage message = CalculationMessage(data, _receivePort.sendPort);
// Spawn an isolate to JSON-parse the file contents. The JSON parsing // Spawn an isolate to JSON-parse the file contents. The JSON parsing
// is synchronous, so if done in the main isolate, the UI would block. // is synchronous, so if done in the main isolate, the UI would block.
Isolate.spawn(_calculate, message).then<Null>((Isolate isolate) { Isolate.spawn<CalculationMessage>(_calculate, message).then<Null>((Isolate isolate) {
if (!isRunning) { if (!isRunning) {
isolate.kill(priority: Isolate.immediate); isolate.kill(priority: Isolate.immediate);
} else { } else {

View File

@ -74,12 +74,12 @@ class AdaptiveContainer extends StatelessWidget {
if (MediaQuery.of(context).size.width < _kGridViewBreakpoint) { if (MediaQuery.of(context).size.width < _kGridViewBreakpoint) {
return ListView( return ListView(
itemExtent: _kListItemExtent, itemExtent: _kListItemExtent,
children: names.map((String name) => AdaptedListItem(name: name)).toList(), children: names.map<Widget>((String name) => AdaptedListItem(name: name)).toList(),
); );
} else { } else {
return GridView.extent( return GridView.extent(
maxCrossAxisExtent: _kMaxTileWidth, maxCrossAxisExtent: _kMaxTileWidth,
children: names.map((String name) => AdaptedGridItem(name: name)).toList(), children: names.map<Widget>((String name) => AdaptedGridItem(name: name)).toList(),
); );
} }
} }

View File

@ -28,7 +28,7 @@ class SectorAppState extends State<SectorApp> {
List<double> wantedSectorSizes = <double>[]; List<double> wantedSectorSizes = <double>[];
List<double> actualSectorSizes = <double>[]; List<double> actualSectorSizes = <double>[];
double get currentTheta => wantedSectorSizes.fold(0.0, (double total, double value) => total + value); double get currentTheta => wantedSectorSizes.fold<double>(0.0, (double total, double value) => total + value);
void addSector() { void addSector() {
final double currentTheta = this.currentTheta; final double currentTheta = this.currentTheta;

View File

@ -20,7 +20,7 @@ HAL: This mission is too important for me to allow you to jeopardize it.''';
// [["Dave", "Open the pod bay..."] ...] // [["Dave", "Open the pod bay..."] ...]
final List<List<String>> _kNameLines = _kDialogText final List<List<String>> _kNameLines = _kDialogText
.split('\n') .split('\n')
.map((String line) => line.split(':')) .map<List<String>>((String line) => line.split(':'))
.toList(); .toList();
final TextStyle _kDaveStyle = TextStyle(color: Colors.indigo.shade400, height: 1.8); final TextStyle _kDaveStyle = TextStyle(color: Colors.indigo.shade400, height: 1.8);

View File

@ -19,7 +19,7 @@ class StockStrings {
static Future<StockStrings> load(Locale locale) { static Future<StockStrings> load(Locale locale) {
return initializeMessages(locale.toString()) return initializeMessages(locale.toString())
.then((Object _) { .then<StockStrings>((Object _) {
return StockStrings(locale); return StockStrings(locale);
}); });
} }

View File

@ -191,7 +191,7 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv
final Future<Null> ticker = _buttonHeldDown final Future<Null> ticker = _buttonHeldDown
? _animationController.animateTo(1.0, duration: kFadeOutDuration) ? _animationController.animateTo(1.0, duration: kFadeOutDuration)
: _animationController.animateTo(0.0, duration: kFadeInDuration); : _animationController.animateTo(0.0, duration: kFadeInDuration);
ticker.then((Null value) { ticker.then<void>((Null value) {
if (mounted && wasHeldDown != _buttonHeldDown) if (mounted && wasHeldDown != _buttonHeldDown)
_animate(); _animate();
}); });

View File

@ -1564,7 +1564,7 @@ class _RenderCupertinoDialogActions extends RenderBox
) )
: Rect.zero; : Rect.zero;
final List<Rect> pressedButtonRects = _pressedButtons.map((RenderBox pressedButton) { final List<Rect> pressedButtonRects = _pressedButtons.map<Rect>((RenderBox pressedButton) {
final MultiChildLayoutParentData buttonParentData = pressedButton.parentData; final MultiChildLayoutParentData buttonParentData = pressedButton.parentData;
return Rect.fromLTWH( return Rect.fromLTWH(

View File

@ -50,7 +50,7 @@ Future<R> compute<Q, R>(ComputeCallback<Q, R> callback, Q message, { String debu
Timeline.startSync('$debugLabel: start', flow: flow); Timeline.startSync('$debugLabel: start', flow: flow);
final ReceivePort resultPort = ReceivePort(); final ReceivePort resultPort = ReceivePort();
Timeline.finishSync(); Timeline.finishSync();
final Isolate isolate = await Isolate.spawn( final Isolate isolate = await Isolate.spawn<_IsolateConfiguration<Q, R>>(
_spawn, _spawn,
_IsolateConfiguration<Q, R>( _IsolateConfiguration<Q, R>(
callback, callback,

View File

@ -32,7 +32,7 @@ DebugPrintCallback debugPrint = debugPrintThrottled;
/// Used by tests. /// Used by tests.
void debugPrintSynchronously(String message, { int wrapWidth }) { void debugPrintSynchronously(String message, { int wrapWidth }) {
if (wrapWidth != null) { if (wrapWidth != null) {
print(message.split('\n').expand((String line) => debugWordWrap(line, wrapWidth)).join('\n')); print(message.split('\n').expand<String>((String line) => debugWordWrap(line, wrapWidth)).join('\n'));
} else { } else {
print(message); print(message);
} }
@ -42,7 +42,7 @@ void debugPrintSynchronously(String message, { int wrapWidth }) {
/// messages on platforms that rate-limit their logging (for example, Android). /// messages on platforms that rate-limit their logging (for example, Android).
void debugPrintThrottled(String message, { int wrapWidth }) { void debugPrintThrottled(String message, { int wrapWidth }) {
if (wrapWidth != null) { if (wrapWidth != null) {
_debugPrintBuffer.addAll(message.split('\n').expand((String line) => debugWordWrap(line, wrapWidth))); _debugPrintBuffer.addAll(message.split('\n').expand<String>((String line) => debugWordWrap(line, wrapWidth)));
} else { } else {
_debugPrintBuffer.addAll(message.split('\n')); _debugPrintBuffer.addAll(message.split('\n'));
} }

View File

@ -195,7 +195,7 @@ class _PathFrames {
final List<double> opacities; final List<double> opacities;
void paint(ui.Canvas canvas, Color color, _UiPathFactory uiPathFactory, double progress) { void paint(ui.Canvas canvas, Color color, _UiPathFactory uiPathFactory, double progress) {
final double opacity = _interpolate(opacities, progress, lerpDouble); final double opacity = _interpolate<double>(opacities, progress, lerpDouble);
final ui.Paint paint = ui.Paint() final ui.Paint paint = ui.Paint()
..style = PaintingStyle.fill ..style = PaintingStyle.fill
..color = color.withOpacity(color.opacity * opacity); ..color = color.withOpacity(color.opacity * opacity);
@ -227,7 +227,7 @@ class _PathMoveTo extends _PathCommand {
@override @override
void apply(Path path, double progress) { void apply(Path path, double progress) {
final Offset offset = _interpolate(points, progress, Offset.lerp); final Offset offset = _interpolate<Offset>(points, progress, Offset.lerp);
path.moveTo(offset.dx, offset.dy); path.moveTo(offset.dx, offset.dy);
} }
} }
@ -241,9 +241,9 @@ class _PathCubicTo extends _PathCommand {
@override @override
void apply(Path path, double progress) { void apply(Path path, double progress) {
final Offset controlPoint1 = _interpolate(controlPoints1, progress, Offset.lerp); final Offset controlPoint1 = _interpolate<Offset>(controlPoints1, progress, Offset.lerp);
final Offset controlPoint2 = _interpolate(controlPoints2, progress, Offset.lerp); final Offset controlPoint2 = _interpolate<Offset>(controlPoints2, progress, Offset.lerp);
final Offset targetPoint = _interpolate(targetPoints, progress, Offset.lerp); final Offset targetPoint = _interpolate<Offset>(targetPoints, progress, Offset.lerp);
path.cubicTo( path.cubicTo(
controlPoint1.dx, controlPoint1.dy, controlPoint1.dx, controlPoint1.dy,
controlPoint2.dx, controlPoint2.dy, controlPoint2.dx, controlPoint2.dy,
@ -260,7 +260,7 @@ class _PathLineTo extends _PathCommand {
@override @override
void apply(Path path, double progress) { void apply(Path path, double progress) {
final Offset point = _interpolate(points, progress, Offset.lerp); final Offset point = _interpolate<Offset>(points, progress, Offset.lerp);
path.lineTo(point.dx, point.dy); path.lineTo(point.dx, point.dy);
} }
} }

View File

@ -582,7 +582,7 @@ class _Circle {
double weightSum(Iterable<Animation<double>> animations) { double weightSum(Iterable<Animation<double>> animations) {
// We're adding flex values instead of animation values to produce correct // We're adding flex values instead of animation values to produce correct
// ratios. // ratios.
return animations.map(state._evaluateFlex).fold(0.0, (double sum, double value) => sum + value); return animations.map<double>(state._evaluateFlex).fold<double>(0.0, (double sum, double value) => sum + value);
} }
final double allWeights = weightSum(state._animations); final double allWeights = weightSum(state._animations);

View File

@ -278,10 +278,10 @@ class _MergeableMaterialState extends State<MergeableMaterial> with TickerProvid
void didUpdateWidget(MergeableMaterial oldWidget) { void didUpdateWidget(MergeableMaterial oldWidget) {
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
final Set<LocalKey> oldKeys = oldWidget.children.map( final Set<LocalKey> oldKeys = oldWidget.children.map<LocalKey>(
(MergeableMaterialItem child) => child.key (MergeableMaterialItem child) => child.key
).toSet(); ).toSet();
final Set<LocalKey> newKeys = widget.children.map( final Set<LocalKey> newKeys = widget.children.map<LocalKey>(
(MergeableMaterialItem child) => child.key (MergeableMaterialItem child) => child.key
).toSet(); ).toSet();
final Set<LocalKey> newOnly = newKeys.difference(oldKeys); final Set<LocalKey> newOnly = newKeys.difference(oldKeys);

View File

@ -30,7 +30,7 @@ class _AccountPictures extends StatelessWidget {
top: 0.0, top: 0.0,
end: 0.0, end: 0.0,
child: Row( child: Row(
children: (otherAccountsPictures ?? <Widget>[]).take(3).map((Widget picture) { children: (otherAccountsPictures ?? <Widget>[]).take(3).map<Widget>((Widget picture) {
return Padding( return Padding(
padding: const EdgeInsetsDirectional.only(start: 8.0), padding: const EdgeInsetsDirectional.only(start: 8.0),
child: Semantics( child: Semantics(

View File

@ -223,7 +223,7 @@ class AssetImage extends AssetBundleImageProvider {
final Iterable<String> keys = parsedJson.keys; final Iterable<String> keys = parsedJson.keys;
final Map<String, List<String>> parsedManifest = final Map<String, List<String>> parsedManifest =
Map<String, List<String>>.fromIterables(keys, Map<String, List<String>>.fromIterables(keys,
keys.map((String key) => List<String>.from(parsedJson[key]))); keys.map<List<String>>((String key) => List<String>.from(parsedJson[key])));
// TODO(ianh): convert that data structure to the right types. // TODO(ianh): convert that data structure to the right types.
return SynchronousFuture<Map<String, List<String>>>(parsedManifest); return SynchronousFuture<Map<String, List<String>>>(parsedManifest);
} }

View File

@ -355,7 +355,7 @@ class TextSpan extends DiagnosticableTree {
List<DiagnosticsNode> debugDescribeChildren() { List<DiagnosticsNode> debugDescribeChildren() {
if (children == null) if (children == null)
return const <DiagnosticsNode>[]; return const <DiagnosticsNode>[];
return children.map((TextSpan child) { return children.map<DiagnosticsNode>((TextSpan child) {
if (child != null) { if (child != null) {
return child.toDiagnosticsNode(); return child.toDiagnosticsNode();
} else { } else {

View File

@ -214,7 +214,7 @@ abstract class MultiChildLayoutDelegate {
if (_debugChildrenNeedingLayout.length > 1) { if (_debugChildrenNeedingLayout.length > 1) {
throw FlutterError( throw FlutterError(
'The $this custom multichild layout delegate forgot to lay out the following children:\n' 'The $this custom multichild layout delegate forgot to lay out the following children:\n'
' ${_debugChildrenNeedingLayout.map(_debugDescribeChild).join("\n ")}\n' ' ${_debugChildrenNeedingLayout.map<String>(_debugDescribeChild).join("\n ")}\n'
'Each child must be laid out exactly once.' 'Each child must be laid out exactly once.'
); );
} else { } else {

Some files were not shown because too many files have changed in this diff Show More