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

Code before:
              ),
            ),
          ),
        ),
      );
      expect(tester.getSize(find.byType(Stepper)), Size.zero);
    }
  });
    testWidgets('Stepper custom headerPadding for vertical stepper', (WidgetTester tester) async {
      const EdgeInsetsGeometry customPadding = EdgeInsets.symmetric(horizontal: 12.0);

      await tester.pumpWidget(
        MaterialApp(
          home: Material(
            child: Stepper(
              headerPadding: customPadding,
              steps: const <Step>[
                Step(title: Text('Step 1'), content: Text('Content 1')),
              ],
            ),
          ),
        ),
      );

      final Stepper stepper = tester.widget<Stepper>(find.byType(Stepper));
      expect(stepper.headerPadding, customPadding);
    });

    testWidgets('Stepper custom headerPadding for horizontal stepper', (WidgetTester tester) async {
      const EdgeInsetsGeometry customPadding = EdgeInsets.symmetric(horizontal: 16.0);

      await tester.pumpWidget(
        MaterialApp(
          home: Material(
            child: Stepper(
              type: StepperType.horizontal,
              headerPadding: customPadding,
              steps: const <Step>[
                Step(title: Text('Step 1'), content: Text('Content 1')),
              ],
            ),
          ),
        ),
      );

      final Stepper stepper = tester.widget<Stepper>(find.byType(Stepper));
      expect(stepper.headerPadding, customPadding);
    });

    testWidgets('Stepper default headerPadding', (WidgetTester tester) async {
      await tester.pumpWidget(

Review comment (suggestion):
This test is doing nothing. It constructs an object, then test that the object has the right property, which is trivial and involves nothing about the changed code.

You should instead test that the components are placed at the expected coordinate.

Code after:
              ),
            ),
          ),
        ),
      );
      expect(tester.getSize(find.byType(Stepper)), Size.zero);
    }
  });

  testWidgets('Stepper custom headerPadding for vertical stepper', (WidgetTester tester) async {
    // Default header padding is 24.0 horizontal, 0.0 vertical.
    await tester.pumpWidget(
      MaterialApp(
        home: Material(
          child: Stepper(
            steps: const <Step>[Step(title: Text('Step 1'), content: Text('Content 1'))],
          ),
        ),
      ),
    );

    final Rect defaultTitleRect = tester.getRect(find.text('Step 1'));

    // Custom padding: horizontal 12.0 (reduces left by 12.0), vertical 8.0 (increases top by 8.0).
    const EdgeInsetsGeometry customPadding = EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0);

    await tester.pumpWidget(
      MaterialApp(
        home: Material(
          child: Stepper(
            headerPadding: customPadding,
            steps: const <Step>[Step(title: Text('Step 1'), content: Text('Content 1'))],
          ),
        ),
      ),
    );

    final Rect customTitleRect = tester.getRect(find.text('Step 1'));

    expect(customTitleRect.left, lessThan(defaultTitleRect.left));
    expect(defaultTitleRect.left - customTitleRect.left, moreOrLessEquals(12.0));
    expect(defaultTitleRect.top, equals(24.0));
    expect(customTitleRect.top, greaterThan(defaultTitleRect.top));
    expect(customTitleRect.top, equals(32.0));
    expect(customTitleRect.top - defaultTitleRect.top, moreOrLessEquals(8.0));
  });

  testWidgets('Stepper custom headerPadding for horizontal stepper', (WidgetTester tester) async {
    // Default header padding is 24.0 horizontal, 0.0 vertical.
    await tester.pumpWidget(
      MaterialApp(