enable lint prefer_final_in_for_each (#47724)

This commit is contained in:
Alexandre Ardhuin
2020-01-07 16:32:04 +01:00
committed by GitHub
parent fa337f5922
commit 4f9b6cf017
369 changed files with 1219 additions and 1220 deletions

View File

@@ -84,7 +84,7 @@ Iterable<int> generateIterableList() {
int sumIterable(Iterable<int> values) {
int result = 0;
for (int value in values) {
for (final int value in values) {
result += value;
}
return result;

View File

@@ -71,7 +71,7 @@ void main() {
String consumeSpan(Iterable<InlineSpanSemanticsInformation> items) {
String result = '';
for (InlineSpanSemanticsInformation span in items) {
for (final InlineSpanSemanticsInformation span in items) {
result += span.text;
}
return result;
@@ -81,7 +81,7 @@ String consumeSpan(Iterable<InlineSpanSemanticsInformation> items) {
Iterable<InlineSpanSemanticsInformation> combineSemanticsInfoSyncStar(List<InlineSpanSemanticsInformation> inputs) sync* {
String workingText = '';
String workingLabel;
for (InlineSpanSemanticsInformation info in inputs) {
for (final InlineSpanSemanticsInformation info in inputs) {
if (info.requiresOwnNode) {
if (workingText != null) {
yield InlineSpanSemanticsInformation(workingText, semanticsLabel: workingLabel ?? workingText);
@@ -110,7 +110,7 @@ Iterable<InlineSpanSemanticsInformation> combineSemanticsInfoList(List<InlineSpa
String workingText = '';
String workingLabel;
final List<InlineSpanSemanticsInformation> result = <InlineSpanSemanticsInformation>[];
for (InlineSpanSemanticsInformation info in inputs) {
for (final InlineSpanSemanticsInformation info in inputs) {
if (info.requiresOwnNode) {
if (workingText != null) {
result.add(InlineSpanSemanticsInformation(workingText, semanticsLabel: workingLabel ?? workingText));