enable lint prefer_final_in_for_each (#47724)
This commit is contained in:
committed by
GitHub
parent
fa337f5922
commit
4f9b6cf017
@@ -50,7 +50,7 @@ class GalleryTransitionTest {
|
||||
file('${galleryDirectory.path}/build/transition_durations.timeline.json').readAsStringSync(),
|
||||
) as Map<String, dynamic>;
|
||||
final Map<String, List<int>> transitions = <String, List<int>>{};
|
||||
for (String key in original.keys) {
|
||||
for (final String key in original.keys) {
|
||||
transitions[key.replaceAll('/', '')] = List<int>.from(original[key] as List<dynamic>);
|
||||
}
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ class CompileTest {
|
||||
|
||||
final RegExp metricExpression = RegExp(r'([a-zA-Z]+)\(CodeSize\)\: (\d+)');
|
||||
final Map<String, dynamic> metrics = <String, dynamic>{};
|
||||
for (Match m in metricExpression.allMatches(compileLog)) {
|
||||
for (final Match m in metricExpression.allMatches(compileLog)) {
|
||||
metrics[_sdkNameToMetricName(m.group(1))] = int.parse(m.group(2));
|
||||
}
|
||||
if (metrics.length != _kSdkNameToMetricNameMapping.length) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:flutter_devicelab/framework/utils.dart';
|
||||
/// Combines several TaskFunctions with trivial success value into one.
|
||||
TaskFunction combine(List<TaskFunction> tasks) {
|
||||
return () async {
|
||||
for (TaskFunction task in tasks) {
|
||||
for (final TaskFunction task in tasks) {
|
||||
final TaskResult result = await task();
|
||||
if (result.failed) {
|
||||
return result;
|
||||
|
||||
@@ -120,14 +120,14 @@ Future<void> saveCatalogScreenshots({
|
||||
String prefix, // Prefix for all file names.
|
||||
}) async {
|
||||
final List<String> screenshots = <String>[
|
||||
for (FileSystemEntity entity in directory.listSync())
|
||||
for (final FileSystemEntity entity in directory.listSync())
|
||||
if (entity is File && entity.path.endsWith('.png'))
|
||||
entity.path,
|
||||
];
|
||||
|
||||
final List<String> largeNames = <String>[]; // Cloud storage names for the full res screenshots.
|
||||
final List<String> smallNames = <String>[]; // Likewise for the scaled down screenshots.
|
||||
for (String path in screenshots) {
|
||||
for (final String path in screenshots) {
|
||||
final String name = screenshotName(path);
|
||||
largeNames.add('$commit/$prefix$name.png');
|
||||
smallNames.add('$commit/$prefix${name}_small.png');
|
||||
|
||||
Reference in New Issue
Block a user