Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CupertinoDatepicker monthYear mode (flutter#93508) #125603

Merged
merged 39 commits into from May 5, 2023

Conversation

lindsaypj
Copy link
Contributor

@lindsaypj lindsaypj commented Apr 27, 2023

This PR adds a month and year mode to the CupertinoDatePicker. The monthYear mode is the date mode without the day of the month.
monthYearMode

This feature was added at the request of:
[Proposal] CupertinoDatePicker with month and year. #93508

One thing that I was unsure of was the use of the DatePickerDateOrder to determine the monthYear order. It could be considered a workaround since the DatePickerDateOrder is intended to order day, month, and year. This means that a developer could use the DatePickerDateOrder.dmy (day, month, year) or DatePickerDateOrder.mdy (month, day, year) to get the same result.

At first I intended to add a DatePickerMonthYearOrder enum to the localizations, in addition to a new parameter for the CupertinoDatePicker for monthYearOrder, but I ended up reverting these changes (1c61f10) because I had not considered the effects of adding values to the localizations.

I decided it may be better to not add an additional parameter (monthYearOrder) that would go mostly unused. I am very open to feedback or ideas on this matter.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard bot added the f: cupertino flutter/packages/flutter/cupertino repository label Apr 27, 2023
Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with not adding a new property to the constructor or enum to dateOrder just to reorder the picker when in monthYear mode. It adds bloat to the API when the functionality can be handled by what currently exists. In exchange, could you add something explaining how it would work in the documentation for dateOrder? I think that's the most natural approach.

Besides that, this LGTM to me. Thank you for taking the time to do this.

@lindsaypj
Copy link
Contributor Author

Thank you Mitchell! I updated the dateOrder documentation, noting that there are multiple DatePickerDateOrder options that result in the same column order.

Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for taking the time to do this!

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍. Thanks for the solid PR and all of the tests!

The Google testing failure seems like it might be unrelated... Could you push a merge commit @lindsaypj?

packages/flutter/lib/src/cupertino/date_picker.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/cupertino/date_picker.dart Outdated Show resolved Hide resolved
@MitchellGoodwin
Copy link
Contributor

@lindsaypj it looks like the google testing is stuck. Would you mind rebasing in order to restart it? That's normally the most reliable method.

@lindsaypj
Copy link
Contributor Author

lindsaypj commented May 5, 2023

I'm not sure how, but I added commits from master. I created another branch from commit 4f8a45d.

date_picker_month_year_mode

Should I just create another PR, or is there a way to easily remove all the additional commits I created in my failed rebase attempt?

Edit: Actually I managed to revert back to before the rebase. If the google test still doesn't resolve, I will try the rebase again. I was shown the correct way to do it.

@MitchellGoodwin MitchellGoodwin added the autosubmit Merge PR when tree becomes green via auto submit App label May 5, 2023
@auto-submit auto-submit bot merged commit 37f348b into flutter:master May 5, 2023
70 checks passed
tarrinneal pushed a commit to flutter/packages that referenced this pull request May 6, 2023
…3922)

Manual roll Flutter from 0b657236cae4 to 43ac23b4c7b4 (30 revisions)

Manual roll requested by tarrinneal@google.com

flutter/flutter@0b65723...43ac23b

2023-05-05 kevmoo@users.noreply.github.com targets/web.dart - fix typo
(flutter/flutter#126114)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
6b467df16e11 to 758cbadfac1f (2 revisions) (flutter/flutter#126175)
2023-05-05 44755140+werainkhatri@users.noreply.github.com add tests for
dominant bottom sheet in scaffold (flutter/flutter#124472)
2023-05-05 98486346+lindsaypj@users.noreply.github.com Added
CupertinoDatepicker monthYear mode (flutter#93508)
(flutter/flutter#125603)
2023-05-05 36861262+QuncCccccc@users.noreply.github.com Add
`Switch.trackOutlineWidth` property (flutter/flutter#125848)
2023-05-05 47866232+chunhtai@users.noreply.github.com Rename
iosdeeplinksettings to iosuniversallinksettings (flutter/flutter#126173)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
f3efe11f4449 to 6b467df16e11 (3 revisions) (flutter/flutter#126174)
2023-05-05 49291509+albertoazinar@users.noreply.github.com improvement :
removed required kotlin dependency (flutter/flutter#125002)
2023-05-05 b7woreo@gmail.com Fix incorrect assert hint in flutter.groovy
(flutter/flutter#125283)
2023-05-05 102626803+drewroengoogle@users.noreply.github.com Update
.cirrus.yml (flutter/flutter#126166)
2023-05-05 kevmoo@users.noreply.github.com tool: replace top-level
functions with enum properties (flutter/flutter#126167)
2023-05-05 jacksongardner@google.com Use direct dart API from
`dart:ui_web` rather than JS shim. (flutter/flutter#123443)
2023-05-05 68919043+Istiak-Ahmed78@users.noreply.github.com Add sample
code for SliverAppBar (flutter/flutter#125785)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
cef0e9d1a94f to f3efe11f4449 (3 revisions) (flutter/flutter#126163)
2023-05-05 leroux_bruno@yahoo.fr Add a ReorderableListView example with
cards + cleanup existing tests (flutter/flutter#126155)
2023-05-05 engine-flutter-autoroll@skia.org Roll Packages from
6bd59cd to a0f8fd8 (4 revisions) (flutter/flutter#126161)
2023-05-05 102626803+drewroengoogle@users.noreply.github.com Bring back
the failing build_test's (flutter/flutter#126014)
2023-05-05 mdebbar@google.com [web] Use plain platform views in
benchmarks (flutter/flutter#126080)
2023-05-05 tessertaha@gmail.com Fix Material 3 tab indicator weight and
position (flutter/flutter#125883)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
b0f53e7751ad to cef0e9d1a94f (1 revision) (flutter/flutter#126150)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
6f26066144fb to b0f53e7751ad (2 revisions) (flutter/flutter#126148)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
764991e046c6 to 6f26066144fb (1 revision) (flutter/flutter#126141)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
e7cd29153aa9 to 764991e046c6 (1 revision) (flutter/flutter#126137)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
a885ed472eea to e7cd29153aa9 (1 revision) (flutter/flutter#126135)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
c97a0deccbc1 to a885ed472eea (1 revision) (flutter/flutter#126129)
2023-05-05 pateltirth454@gmail.com [NavigationDrawer] adds padding
property in NavigationDrawer Widget (flutter/flutter#123961)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
269ce2deebeb to c97a0deccbc1 (1 revision) (flutter/flutter#126124)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
4d5070672859 to 269ce2deebeb (16 revisions) (flutter/flutter#126115)
2023-05-05 ian@hixie.ch Minor fixes found while working on blankcanvas
(flutter/flutter#125751)
2023-05-05 kevmoo@users.noreply.github.com tool-web: use ProcessUtil.run
to invoke child processes (flutter/flutter#126109)

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
rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com 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
...
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
…lutter#3922)

Manual roll Flutter from 0b657236cae4 to 43ac23b4c7b4 (30 revisions)

Manual roll requested by tarrinneal@google.com

flutter/flutter@0b65723...43ac23b

2023-05-05 kevmoo@users.noreply.github.com targets/web.dart - fix typo
(flutter/flutter#126114)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
6b467df16e11 to 758cbadfac1f (2 revisions) (flutter/flutter#126175)
2023-05-05 44755140+werainkhatri@users.noreply.github.com add tests for
dominant bottom sheet in scaffold (flutter/flutter#124472)
2023-05-05 98486346+lindsaypj@users.noreply.github.com Added
CupertinoDatepicker monthYear mode (flutter#93508)
(flutter/flutter#125603)
2023-05-05 36861262+QuncCccccc@users.noreply.github.com Add
`Switch.trackOutlineWidth` property (flutter/flutter#125848)
2023-05-05 47866232+chunhtai@users.noreply.github.com Rename
iosdeeplinksettings to iosuniversallinksettings (flutter/flutter#126173)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
f3efe11f4449 to 6b467df16e11 (3 revisions) (flutter/flutter#126174)
2023-05-05 49291509+albertoazinar@users.noreply.github.com improvement :
removed required kotlin dependency (flutter/flutter#125002)
2023-05-05 b7woreo@gmail.com Fix incorrect assert hint in flutter.groovy
(flutter/flutter#125283)
2023-05-05 102626803+drewroengoogle@users.noreply.github.com Update
.cirrus.yml (flutter/flutter#126166)
2023-05-05 kevmoo@users.noreply.github.com tool: replace top-level
functions with enum properties (flutter/flutter#126167)
2023-05-05 jacksongardner@google.com Use direct dart API from
`dart:ui_web` rather than JS shim. (flutter/flutter#123443)
2023-05-05 68919043+Istiak-Ahmed78@users.noreply.github.com Add sample
code for SliverAppBar (flutter/flutter#125785)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
cef0e9d1a94f to f3efe11f4449 (3 revisions) (flutter/flutter#126163)
2023-05-05 leroux_bruno@yahoo.fr Add a ReorderableListView example with
cards + cleanup existing tests (flutter/flutter#126155)
2023-05-05 engine-flutter-autoroll@skia.org Roll Packages from
6bd59cd to a0f8fd8 (4 revisions) (flutter/flutter#126161)
2023-05-05 102626803+drewroengoogle@users.noreply.github.com Bring back
the failing build_test's (flutter/flutter#126014)
2023-05-05 mdebbar@google.com [web] Use plain platform views in
benchmarks (flutter/flutter#126080)
2023-05-05 tessertaha@gmail.com Fix Material 3 tab indicator weight and
position (flutter/flutter#125883)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
b0f53e7751ad to cef0e9d1a94f (1 revision) (flutter/flutter#126150)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
6f26066144fb to b0f53e7751ad (2 revisions) (flutter/flutter#126148)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
764991e046c6 to 6f26066144fb (1 revision) (flutter/flutter#126141)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
e7cd29153aa9 to 764991e046c6 (1 revision) (flutter/flutter#126137)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
a885ed472eea to e7cd29153aa9 (1 revision) (flutter/flutter#126135)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
c97a0deccbc1 to a885ed472eea (1 revision) (flutter/flutter#126129)
2023-05-05 pateltirth454@gmail.com [NavigationDrawer] adds padding
property in NavigationDrawer Widget (flutter/flutter#123961)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
269ce2deebeb to c97a0deccbc1 (1 revision) (flutter/flutter#126124)
2023-05-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
4d5070672859 to 269ce2deebeb (16 revisions) (flutter/flutter#126115)
2023-05-05 ian@hixie.ch Minor fixes found while working on blankcanvas
(flutter/flutter#125751)
2023-05-05 kevmoo@users.noreply.github.com tool-web: use ProcessUtil.run
to invoke child processes (flutter/flutter#126109)

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
rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com 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
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants