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
dc1eefa9
Commit
dc1eefa9
authored
Feb 07, 2019
by
Alexander Ryzhov
Committed by
xster
Feb 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #27621: CupertinoTimerPicker breaks if minuteInterval > 1 (#27647)
parent
e5e89529
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
date_picker.dart
packages/flutter/lib/src/cupertino/date_picker.dart
+2
-2
date_picker_test.dart
packages/flutter/test/cupertino/date_picker_test.dart
+33
-0
No files found.
packages/flutter/lib/src/cupertino/date_picker.dart
View file @
dc1eefa9
...
...
@@ -1150,7 +1150,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
backgroundColor:
_kBackgroundColor
,
onSelectedItemChanged:
(
int
index
)
{
setState
(()
{
selectedMinute
=
index
;
selectedMinute
=
index
*
widget
.
minuteInterval
;
widget
.
onTimerDurationChanged
(
Duration
(
hours:
selectedHour
??
0
,
...
...
@@ -1262,7 +1262,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
backgroundColor:
_kBackgroundColor
,
onSelectedItemChanged:
(
int
index
)
{
setState
(()
{
selectedSecond
=
index
;
selectedSecond
=
index
*
widget
.
secondInterval
;
widget
.
onTimerDurationChanged
(
Duration
(
hours:
selectedHour
??
0
,
...
...
packages/flutter/test/cupertino/date_picker_test.dart
View file @
dc1eefa9
...
...
@@ -198,6 +198,39 @@ void main() {
);
});
});
testWidgets
(
'picker honors minuteInterval and secondInterval'
,
(
WidgetTester
tester
)
async
{
Duration
duration
;
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
SizedBox
(
height:
400.0
,
width:
400.0
,
child:
CupertinoTimerPicker
(
minuteInterval:
10
,
secondInterval:
15
,
initialTimerDuration:
const
Duration
(
hours:
10
,
minutes:
40
,
seconds:
45
),
mode:
CupertinoTimerPickerMode
.
hms
,
onTimerDurationChanged:
(
Duration
d
)
{
duration
=
d
;
},
),
),
),
);
await
tester
.
drag
(
find
.
text
(
'40'
),
_kRowOffset
);
await
tester
.
pump
();
await
tester
.
drag
(
find
.
text
(
'45'
),
-
_kRowOffset
);
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
milliseconds:
500
));
expect
(
duration
,
const
Duration
(
hours:
10
,
minutes:
50
,
seconds:
30
),
);
});
group
(
'Date picker'
,
()
{
testWidgets
(
'mode is not null'
,
(
WidgetTester
tester
)
async
{
expect
(
...
...
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