Fix material date picker behavior when changing year#130486
Merged
auto-submit[bot] merged 6 commits intoflutter:masterfrom Jul 24, 2023
Merged
Fix material date picker behavior when changing year#130486auto-submit[bot] merged 6 commits intoflutter:masterfrom
auto-submit[bot] merged 6 commits intoflutter:masterfrom
Conversation
…le. Respects boundaries of firstDate and lastDate.
HansMuller
approved these changes
Jul 21, 2023
Contributor
HansMuller
left a comment
There was a problem hiding this comment.
Looks like a good fix. @TahaTesser - please take a look
Co-authored-by: Taha Tesser <[email protected]>
Co-authored-by: Taha Tesser <[email protected]>
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 25, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 25, 2023
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
Jul 25, 2023
flutter/flutter@d7ed5dc...9def8f6 2023-07-25 [email protected] Proposal to add barrier configs for showDatePicker, showTimePicker and showAboutDialog. (flutter/flutter#130484) 2023-07-25 [email protected] Roll Flutter Engine from a7a842ee9ccd to 036c58f79307 (1 revision) (flutter/flutter#131244) 2023-07-25 [email protected] Roll Flutter Engine from 3baca2fe55c8 to a7a842ee9ccd (1 revision) (flutter/flutter#131243) 2023-07-25 [email protected] Roll Flutter Engine from 9a0192d965e0 to 3baca2fe55c8 (1 revision) (flutter/flutter#131241) 2023-07-25 [email protected] Roll Flutter Engine from ceb2674e82b4 to 9a0192d965e0 (3 revisions) (flutter/flutter#131230) 2023-07-25 [email protected] Roll Flutter Engine from 4fded78e5a01 to ceb2674e82b4 (2 revisions) (flutter/flutter#131229) 2023-07-25 [email protected] Roll Flutter Engine from ff02fa72acce to 4fded78e5a01 (2 revisions) (flutter/flutter#131225) 2023-07-24 [email protected] Roll Flutter Engine from a489c7496268 to ff02fa72acce (1 revision) (flutter/flutter#131221) 2023-07-24 [email protected] Roll Flutter Engine from 815b97157dc7 to a489c7496268 (3 revisions) (flutter/flutter#131218) 2023-07-24 [email protected] Roll Flutter Engine from 2b8d83fa20e3 to 815b97157dc7 (5 revisions) (flutter/flutter#131214) 2023-07-24 [email protected] Use toStringAsFixed in DecorationImage.toString (flutter/flutter#131026) 2023-07-24 [email protected] Roll Flutter Engine from aa876f6bec69 to 2b8d83fa20e3 (3 revisions) (flutter/flutter#131207) 2023-07-24 [email protected] Fix M3 TimePicker dial background uses incorrect color (flutter/flutter#131045) 2023-07-24 [email protected] Fix floating SnackBar throws when FAB is on the top (flutter/flutter#129274) 2023-07-24 [email protected] Update link to unbounded constraints error (flutter/flutter#131205) 2023-07-24 [email protected] Optimize SliverMainAxisGroup/SliverCrossAxisGroup paint function (flutter/flutter#129310) 2023-07-24 [email protected] [DropdownMenu] Close menu after editing is complete (flutter/flutter#130710) 2023-07-24 [email protected] Reduce usage of testUsingContext (flutter/flutter#131078) 2023-07-24 [email protected] Roll Packages from 2266a76 to 8028caf (13 revisions) (flutter/flutter#131196) 2023-07-24 [email protected] Fix material date picker behavior when changing year (flutter/flutter#130486) 2023-07-24 [email protected] Update Gallery demo app themes for Material3 compatibility (flutter/flutter#131093) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu
pushed a commit
to LouiseHsu/flutter
that referenced
this pull request
Jul 31, 2023
This PR changes the material date picker behavior when changing the year so that it matches the native picker and the material component guideline. (flutter#81547) See material component guideline for the date picker: [Material component date-picker behavior](https://m3.material.io/components/date-pickers/guidelines#1531a81f-4052-4a75-a20d-228c7e110156) See also: [Material components android discussion](material-components/material-components-android#1723) When selecting another year in the native picker, the same day will be selected (by respecting the boundaries of the date picker). The current material date picker does not select any day when changing the year. This will lead to confusion if the user presses OK and the year does not get updated. So here is my suggestion: It will try to preselect the day like the native picker: - respecting the boundaries of the date picker (firstDate, lastDate) - changing from leapyear 29th february will set 28th february if not a leapyear is selected - only set the day if it is selectable (selectableDayPredicate) The calendar shown in the recording was setup with this parameters: ``` firstDate: DateTime(2016, DateTime.june, 9), initialDate: DateTime(2018, DateTime.may, 4), lastDate: DateTime(2021, DateTime.january, 15), ``` https://github.com/flutter/flutter/assets/13588771/3041c296-b9d0-4078-88cd-d1135fc343b3 Fixes flutter#81547
vashworth
pushed a commit
to vashworth/flutter
that referenced
this pull request
Aug 2, 2023
This PR changes the material date picker behavior when changing the year so that it matches the native picker and the material component guideline. (flutter#81547) See material component guideline for the date picker: [Material component date-picker behavior](https://m3.material.io/components/date-pickers/guidelines#1531a81f-4052-4a75-a20d-228c7e110156) See also: [Material components android discussion](material-components/material-components-android#1723) When selecting another year in the native picker, the same day will be selected (by respecting the boundaries of the date picker). The current material date picker does not select any day when changing the year. This will lead to confusion if the user presses OK and the year does not get updated. So here is my suggestion: It will try to preselect the day like the native picker: - respecting the boundaries of the date picker (firstDate, lastDate) - changing from leapyear 29th february will set 28th february if not a leapyear is selected - only set the day if it is selectable (selectableDayPredicate) The calendar shown in the recording was setup with this parameters: ``` firstDate: DateTime(2016, DateTime.june, 9), initialDate: DateTime(2018, DateTime.may, 4), lastDate: DateTime(2021, DateTime.january, 15), ``` https://github.com/flutter/flutter/assets/13588771/3041c296-b9d0-4078-88cd-d1135fc343b3 Fixes flutter#81547
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the material date picker behavior when changing the year so that it matches the native picker and the material component guideline. (#81547)
See material component guideline for the date picker: Material component date-picker behavior
See also: Material components android discussion
When selecting another year in the native picker, the same day will be selected (by respecting the boundaries of the date picker). The current material date picker does not select any day when changing the year. This will lead to confusion if the user presses OK and the year does not get updated.
So here is my suggestion:
It will try to preselect the day like the native picker:
The calendar shown in the recording was setup with this parameters:
Android-Date-Picker-changes.mov
Fixes #81547
Pre-launch Checklist
///).