mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that a CupertinoPicker doesn't crash in 0x0 environment (#179258)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the CupertinoPicker widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
parent
2300260b28
commit
fe9a609404
@ -831,4 +831,21 @@ void main() {
|
||||
await tester.pump(tapScrollDuration + infinitesimalPause);
|
||||
expect(selectedItem, equals(2));
|
||||
});
|
||||
|
||||
testWidgets('CupertinoPicker does not crash at zero area', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
CupertinoApp(
|
||||
home: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 2.0,
|
||||
onSelectedItemChanged: (_) {},
|
||||
children: const <Widget>[Text('X'), Text('Y')],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(tester.getSize(find.byType(CupertinoPicker)), Size.zero);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user