This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -465,8 +465,6 @@ class _RenderCupertinoPickerSemantics extends RenderProxyBox {
465
465
}
466
466
467
467
void _handleDecrease () {
468
- if (_currentIndex == 0 )
469
- return ;
470
468
controller.jumpToItem (_currentIndex - 1 );
471
469
}
472
470
Original file line number Diff line number Diff line change @@ -1517,6 +1517,37 @@ void main() {
1517
1517
handle.dispose ();
1518
1518
});
1519
1519
1520
+ // Regression test for https://github.com/flutter/flutter/issues/98567
1521
+ testWidgets ('picker semantics action test' , (WidgetTester tester) async {
1522
+ final SemanticsHandle handle = tester.ensureSemantics ();
1523
+ debugResetSemanticsIdCounter ();
1524
+ final DateTime initialDate = DateTime (2018 , 6 , 8 );
1525
+ late DateTime ? date;
1526
+ await tester.pumpWidget (
1527
+ CupertinoApp (
1528
+ home: Center (
1529
+ child: SizedBox (
1530
+ height: 400.0 ,
1531
+ width: 400.0 ,
1532
+ child: CupertinoDatePicker (
1533
+ onDateTimeChanged: (DateTime newDate) => date = newDate,
1534
+ initialDateTime: initialDate,
1535
+ maximumDate: initialDate.add (const Duration (days: 2 )),
1536
+ minimumDate: initialDate.subtract (const Duration (days: 2 )),
1537
+ ),
1538
+ ),
1539
+ ),
1540
+ ),
1541
+ );
1542
+
1543
+ tester.binding.pipelineOwner.semanticsOwner! .performAction (4 , SemanticsAction .decrease);
1544
+ await tester.pumpAndSettle ();
1545
+
1546
+ expect (date, DateTime (2018 , 6 , 7 ));
1547
+
1548
+ handle.dispose ();
1549
+ });
1550
+
1520
1551
testWidgets ('DatePicker adapts to MaterialApp dark mode' , (WidgetTester tester) async {
1521
1552
Widget buildDatePicker (Brightness brightness) {
1522
1553
return MaterialApp (
You can’t perform that action at this time.
0 commit comments