Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a7a72ce9
Unverified
Commit
a7a72ce9
authored
May 06, 2022
by
xubaolin
Committed by
GitHub
May 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a [CupertinoDatePicker] semantics bug (#103123)
parent
eee051ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
picker.dart
packages/flutter/lib/src/cupertino/picker.dart
+0
-2
date_picker_test.dart
packages/flutter/test/cupertino/date_picker_test.dart
+31
-0
No files found.
packages/flutter/lib/src/cupertino/picker.dart
View file @
a7a72ce9
...
...
@@ -465,8 +465,6 @@ class _RenderCupertinoPickerSemantics extends RenderProxyBox {
}
void
_handleDecrease
()
{
if
(
_currentIndex
==
0
)
return
;
controller
.
jumpToItem
(
_currentIndex
-
1
);
}
...
...
packages/flutter/test/cupertino/date_picker_test.dart
View file @
a7a72ce9
...
...
@@ -1517,6 +1517,37 @@ void main() {
handle
.
dispose
();
});
// Regression test for https://github.com/flutter/flutter/issues/98567
testWidgets
(
'picker semantics action test'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
debugResetSemanticsIdCounter
();
final
DateTime
initialDate
=
DateTime
(
2018
,
6
,
8
);
late
DateTime
?
date
;
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
Center
(
child:
SizedBox
(
height:
400.0
,
width:
400.0
,
child:
CupertinoDatePicker
(
onDateTimeChanged:
(
DateTime
newDate
)
=>
date
=
newDate
,
initialDateTime:
initialDate
,
maximumDate:
initialDate
.
add
(
const
Duration
(
days:
2
)),
minimumDate:
initialDate
.
subtract
(
const
Duration
(
days:
2
)),
),
),
),
),
);
tester
.
binding
.
pipelineOwner
.
semanticsOwner
!.
performAction
(
4
,
SemanticsAction
.
decrease
);
await
tester
.
pumpAndSettle
();
expect
(
date
,
DateTime
(
2018
,
6
,
7
));
handle
.
dispose
();
});
testWidgets
(
'DatePicker adapts to MaterialApp dark mode'
,
(
WidgetTester
tester
)
async
{
Widget
buildDatePicker
(
Brightness
brightness
)
{
return
MaterialApp
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment