Unverified Commit 14dcbb2d authored by Jimmy Wei's avatar Jimmy Wei Committed by GitHub

Fix overflow issue caused by a long title/subtitle for the vertical stepper (#61623)

parent 30e556dd
...@@ -520,9 +520,11 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin { ...@@ -520,9 +520,11 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
_buildLine(!_isLast(index)), _buildLine(!_isLast(index)),
], ],
), ),
Container( Expanded(
margin: const EdgeInsetsDirectional.only(start: 12.0), child: Container(
child: _buildHeaderText(index), margin: const EdgeInsetsDirectional.only(start: 12.0),
child: _buildHeaderText(index),
)
), ),
], ],
), ),
......
...@@ -663,4 +663,57 @@ void main() { ...@@ -663,4 +663,57 @@ void main() {
await tester.pump(); await tester.pump();
expect(disabledNode.hasPrimaryFocus, isFalse); expect(disabledNode.hasPrimaryFocus, isFalse);
}); });
testWidgets('Stepper header title should not overflow', (WidgetTester tester) async {
const String longText =
'A long long long long long long long long long long long long text';
await tester.pumpWidget(
MaterialApp(
home: Material(
child: ListView(
children: <Widget>[
Stepper(
steps: const <Step>[
Step(
title: Text(longText),
content: Text('Text content')
),
],
),
],
),
),
),
);
expect(tester.takeException(), isNull);
});
testWidgets('Stepper header subtitle should not overflow', (WidgetTester tester) async {
const String longText =
'A long long long long long long long long long long long long text';
await tester.pumpWidget(
MaterialApp(
home: Material(
child: ListView(
children: <Widget>[
Stepper(
steps: const <Step>[
Step(
title: Text('Regular title'),
subtitle: Text(longText),
content: Text('Text content')
),
],
),
],
),
),
),
);
expect(tester.takeException(), isNull);
});
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment