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:
Ahmed Mohamed Sameh 2025-12-10 02:22:36 +02:00 committed by GitHub
parent 6e611e04b7
commit 4c24578e2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
});
}