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
c7a6e300
Unverified
Commit
c7a6e300
authored
Mar 30, 2020
by
Darren Austin
Committed by
GitHub
Mar 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug with the month grid showing the wrong month after selecting a date. (#53594)
parent
08ee37e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
calendar_date_picker.dart
...lutter/lib/src/material/pickers/calendar_date_picker.dart
+0
-1
date_picker_test.dart
packages/flutter/test/material/date_picker_test.dart
+14
-0
No files found.
packages/flutter/lib/src/material/pickers/calendar_date_picker.dart
View file @
c7a6e300
...
...
@@ -592,7 +592,6 @@ class _MonthPickerState extends State<_MonthPicker> {
_DayHeaders
(),
Expanded
(
child:
PageView
.
builder
(
key:
ValueKey
<
DateTime
>(
widget
.
selectedDate
),
controller:
_pageController
,
itemBuilder:
_buildItems
,
itemCount:
utils
.
monthDelta
(
widget
.
firstDate
,
widget
.
lastDate
)
+
1
,
...
...
packages/flutter/test/material/date_picker_test.dart
View file @
c7a6e300
...
...
@@ -278,6 +278,20 @@ void main() {
});
});
testWidgets
(
'Selecting date does not change displayed month'
,
(
WidgetTester
tester
)
async
{
initialDate
=
DateTime
(
2020
,
DateTime
.
march
,
15
);
await
prepareDatePicker
(
tester
,
(
Future
<
DateTime
>
date
)
async
{
await
tester
.
tap
(
nextMonthIcon
);
await
tester
.
pumpAndSettle
(
const
Duration
(
seconds:
1
));
expect
(
find
.
text
(
'April 2020'
),
findsOneWidget
);
await
tester
.
tap
(
find
.
text
(
'25'
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'April 2020'
),
findsOneWidget
);
// There isn't a 31 in April so there shouldn't be one if it is showing April
expect
(
find
.
text
(
'31'
),
findsNothing
);
});
});
testWidgets
(
'Changing year does not change selected date'
,
(
WidgetTester
tester
)
async
{
await
prepareDatePicker
(
tester
,
(
Future
<
DateTime
>
date
)
async
{
await
tester
.
tap
(
find
.
text
(
'January 2016'
));
...
...
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