mirror of
https://github.com/flutter/flutter.git
synced 2026-01-09 07:51:35 +08:00
Make sure that a Stepper doesn't crash in 0x0 environment (#178068)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the Stepper widget. --------- Co-authored-by: Victor Sanni <victorsanniay@gmail.com> Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
parent
554dfee06f
commit
f64ddb8cb8
@ -1683,6 +1683,29 @@ void main() {
|
||||
expect(colors.first, equals(activeColor));
|
||||
expect(colors.last, equals(activeColor));
|
||||
});
|
||||
|
||||
testWidgets('Stepper does not crash at zero area', (WidgetTester tester) async {
|
||||
for (final StepperType type in StepperType.values) {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: Stepper(
|
||||
type: type,
|
||||
steps: const <Step>[
|
||||
Step(title: Text('X'), content: Text('X')),
|
||||
Step(title: Text('Y'), content: Text('Y')),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(tester.getSize(find.byType(Stepper)), Size.zero);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class _TappableColorWidget extends StatefulWidget {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user