diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart index d47f7a26e9..24c11a7f61 100644 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -674,6 +674,7 @@ class _StepperState extends State with TickerProviderStateMixin { ), Expanded( child: ListView( + physics: widget.physics, padding: const EdgeInsets.all(24.0), children: [ AnimatedSize( diff --git a/packages/flutter/test/material/stepper_test.dart b/packages/flutter/test/material/stepper_test.dart index ca1bb412d3..12bf7a15ec 100644 --- a/packages/flutter/test/material/stepper_test.dart +++ b/packages/flutter/test/material/stepper_test.dart @@ -817,4 +817,33 @@ void main() { expect(buttonMaterial('CANCEL').color.value, 0); expect(buttonMaterial('CANCEL').textStyle.color.value, 0x61ffffff); }); + + testWidgets('Vertical and Horizontal Stepper physics test', (WidgetTester tester) async { + const ScrollPhysics physics = NeverScrollableScrollPhysics(); + + for(final StepperType type in StepperType.values) { + await tester.pumpWidget( + MaterialApp( + home: Material( + child: Stepper( + physics: physics, + type: type, + steps: const [ + Step( + title: Text('Step 1'), + content: SizedBox( + width: 100.0, + height: 100.0, + ), + ), + ], + ), + ), + ), + ); + + final ListView listView = tester.widget(find.descendant(of: find.byType(Stepper), matching: find.byType(ListView))); + expect(listView.physics, physics); + } + }); }