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

@@ -7,7 +7,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
for (String language in kCupertinoSupportedLanguages) {
for (final String language in kCupertinoSupportedLanguages) {
testWidgets('translations exist for $language', (WidgetTester tester) async {
final Locale locale = Locale(language);

View File

@@ -51,7 +51,7 @@ void main() {
},
};
for (Locale locale in testLocales.keys) {
for (final Locale locale in testLocales.keys) {
testWidgets('shows dates for $locale', (WidgetTester tester) async {
final List<String> expectedDaysOfWeek = testLocales[locale]['expectedDaysOfWeek'] as List<String>;
final List<String> expectedDaysOfMonth = testLocales[locale]['expectedDaysOfMonth'] as List<String>;
@@ -70,12 +70,12 @@ void main() {
expect(find.text(expectedMonthYearHeader), findsOneWidget);
for (String dayOfWeek in expectedDaysOfWeek) {
for (final String dayOfWeek in expectedDaysOfWeek) {
expect(find.text(dayOfWeek), findsWidgets);
}
Offset previousCellOffset;
for (String dayOfMonth in expectedDaysOfMonth) {
for (final String dayOfMonth in expectedDaysOfMonth) {
final Finder dayCell = find.descendant(of: find.byType(GridView), matching: find.text(dayOfMonth));
expect(dayCell, findsOneWidget);

View File

@@ -68,7 +68,7 @@ void main() {
const Locale('zh', 'ZH'): const <String>['period', 'hour', 'string :', 'minute'], //'ah:mm'
};
for (Locale locale in locales.keys) {
for (final Locale locale in locales.keys) {
final Offset center = await startPicker(tester, (TimeOfDay time) { }, locale: locale);
final List<String> actual = <String>[];
tester.element(find.byType(CustomMultiChildLayout)).visitChildren((Element child) {
@@ -114,7 +114,7 @@ void main() {
Locale('en', 'GB'), // HH
Locale('es', 'ES'), // H
];
for (Locale locale in locales) {
for (final Locale locale in locales) {
// Tap along the segment stretching from the center to the edge at
// 12:00 AM position. There are two rings. At ~70% mark, the ring
// switches between inner ring and outer ring.

View File

@@ -7,7 +7,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
for (String language in kMaterialSupportedLanguages) {
for (final String language in kMaterialSupportedLanguages) {
testWidgets('translations exist for $language', (WidgetTester tester) async {
final Locale locale = Locale(language);