Repository: flutter/flutter
File: packages/flutter/test/material/switch_list_tile_test.dart (Dart)

Code before:
                  top: 30.0,
                  bottom: 40.0,
                ),
                secondary: const Text('L'),
                title: const Text('title'),
                value: true,
                onChanged: (bool selected) {},
              ),
            ),
          ),
        ),
      );
    }

    await tester.pumpWidget(buildFrame(TextDirection.ltr));

    expect(tester.getTopLeft(find.text('L')).dx, 10.0); // contentPadding.start = 10
    expect(tester.getTopRight(find.byType(Switch)).dx, 780.0); // 800 - contentPadding.end

    await tester.pumpWidget(buildFrame(TextDirection.rtl));

    expect(tester.getTopLeft(find.byType(Switch)).dx, 20.0); // contentPadding.end = 20
    expect(tester.getTopRight(find.text('L')).dx, 790.0); // 800 - contentPadding.start
  });
  testWidgets('SwitchListTile forwards statesController to ListTile', (WidgetTester tester) async {
    final controller = WidgetStatesController();
    addTearDown(controller.dispose);

    await tester.pumpWidget(
      MaterialApp(
        home: Material(
          child: ListView(
            children: <Widget>[
              SwitchListTile(
                value: true,
                onChanged: (_) {},
                title: const Text('Switch'),
                statesController: controller,
              ),
            ],
          ),
        ),
      ),
    );

    final ListTile listTile = tester.widget<ListTile>(find.byType(ListTile));

    expect(listTile.statesController, same(controller));
  });

  testWidgets('SwitchListTile can autofocus unless disabled.', (WidgetTester tester) async {

Review comment (suggestion):
```suggestion

  testWidgets('SwitchListTile forwards statesController to ListTile', (WidgetTester tester) async {
```

Code after:
                  top: 30.0,
                  bottom: 40.0,
                ),
                secondary: const Text('L'),
                title: const Text('title'),
                value: true,
                onChanged: (bool selected) {},
              ),
            ),
          ),
        ),
      );
    }

    await tester.pumpWidget(buildFrame(TextDirection.ltr));

    expect(tester.getTopLeft(find.text('L')).dx, 10.0); // contentPadding.start = 10
    expect(tester.getTopRight(find.byType(Switch)).dx, 780.0); // 800 - contentPadding.end

    await tester.pumpWidget(buildFrame(TextDirection.rtl));

    expect(tester.getTopLeft(find.byType(Switch)).dx, 20.0); // contentPadding.end = 20
    expect(tester.getTopRight(find.text('L')).dx, 790.0); // 800 - contentPadding.start
  });

  testWidgets('SwitchListTile forwards statesController to ListTile', (WidgetTester tester) async {
    final controller = WidgetStatesController();
    addTearDown(controller.dispose);

    await tester.pumpWidget(
      MaterialApp(
        home: Material(
          child: ListView(
            children: <Widget>[
              SwitchListTile(
                value: true,
                onChanged: (_) {},
                title: const Text('Switch'),
                statesController: controller,
              ),
            ],
          ),
        ),
      ),
    );

    final ListTile listTile = tester.widget<ListTile>(find.byType(ListTile));

    expect(listTile.statesController, same(controller));
  });