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

@@ -61,10 +61,10 @@ Future<void> main() async {
print('Starting app...');
runApp(const GalleryApp(testMode: true));
final _LiveWidgetController controller = _LiveWidgetController(WidgetsBinding.instance);
for (GalleryDemoCategory category in kAllGalleryDemoCategories) {
for (final GalleryDemoCategory category in kAllGalleryDemoCategories) {
print('Tapping "${category.name}" section...');
await controller.tap(find.text(category.name));
for (GalleryDemo demo in kGalleryCategoryToDemos[category]) {
for (final GalleryDemo demo in kGalleryCategoryToDemos[category]) {
final Finder demoItem = find.text(demo.title);
print('Scrolling to "${demo.title}"...');
await controller.scrollIntoView(demoItem, alignment: 0.5);

View File

@@ -42,7 +42,7 @@ void verifyToStringOutput(String name, String route, String testString) {
final List<String> lines = testString.split('\n');
if (!testString.endsWith('\n'))
reportToStringError(name, route, lines.length, lines, 'does not end with a line feed');
for (String line in lines) {
for (final String line in lines) {
lineNumber += 1;
if (line == '' && lineNumber != lines.length) {
reportToStringError(name, route, lineNumber, lines, 'found empty line');
@@ -157,11 +157,11 @@ Future<void> smokeGallery(WidgetTester tester) async {
expect(find.text(kGalleryTitle), findsOneWidget);
for (GalleryDemoCategory category in kAllGalleryDemoCategories) {
for (final GalleryDemoCategory category in kAllGalleryDemoCategories) {
await Scrollable.ensureVisible(tester.element(find.text(category.name)), alignment: 0.5);
await tester.tap(find.text(category.name));
await tester.pumpAndSettle();
for (GalleryDemo demo in kGalleryCategoryToDemos[category]) {
for (final GalleryDemo demo in kGalleryCategoryToDemos[category]) {
await Scrollable.ensureVisible(tester.element(find.text(demo.title)), alignment: 0.0);
await smokeDemo(tester, demo);
tester.binding.debugAssertNoTransientCallbacks('A transient callback was still active after running $demo');