mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that a CupertinoSlider doesn't crash in 0x0 environment (#179566)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the CupertinoSlider widget.
This commit is contained in:
parent
6e611e04b7
commit
4c24578e2b
@ -831,4 +831,15 @@ void main() {
|
||||
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('CupertinoSlider does not crash at zero area', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
CupertinoApp(
|
||||
home: Center(
|
||||
child: SizedBox.shrink(child: CupertinoSlider(value: 0.0, onChanged: (_) {})),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(tester.getSize(find.byType(CupertinoSlider)), Size.zero);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user