-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Docs: Update date picker theme day color properties doc #166122
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
Docs: Update date picker theme day color properties doc #166122
Conversation
5a01c9e to
e75d24b
Compare
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
MitchellGoodwin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been thinking about this PR, and I'm not convinced that these properties are necessary. The combinations of dayOverlayColor, dayForegroundColor and dayBackgroundColor should cover the necessary styling options. These properties seem like they clash with dayOverlayColor, and what do they do differently from adding the logic to look for the selected property in dayBackgroundColor and dayForegroundColor?
Make sense, by looking at #161052 (comment) I thought dayOverlayColor, dayForegroundColor and dayBackgroundColor are of type Color but actually its of type WidgetStateProperty. So, I think here making doc change is enough rather than adding property. |
e75d24b to
00b596c
Compare
MitchellGoodwin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for converting to a documentation change. I think this will really improve clarity.
| /// This will be used instead of the color provided in [dayStyle]. | ||
| /// | ||
| /// This supports different colors based on the [WidgetState]s of | ||
| /// the day button, such as [WidgetState.selected], [WidgetState.hovered], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: slightly prefer using ` instead of [. I think linking directly to the values of WidgetState currently breaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i am not wrong, then In theme properties, we don't directly use values, because user can give their own theme rather that default provided theme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant the documentation breaks. Dart doc seem to handle some enums poorly.
If you click on WidgetState.pressed it goes to an invalid page. Same with the others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, Sorry I misunderstood. Yaa, I saw a open issue related to this.
I have pushed the change as you mentioned.
af96c03 to
68bceba
Compare
MitchellGoodwin
left a comment
There was a problem hiding this 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 making these changes.
QuncCccccc
left a comment
There was a problem hiding this 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 adding the doc!
| /// if (states.contains(WidgetState.selected)) { | ||
| /// return Theme.of(context).colorScheme.primary; | ||
| /// } | ||
| /// return Colors.transparent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can set this else part to null to remind developers that setting to null will just return the default color:)
| /// return Colors.transparent; | |
| /// return null; // Use the default color. |
| /// if (states.contains(WidgetState.selected)) { | ||
| /// return Theme.of(context).colorScheme.primary; | ||
| /// } | ||
| /// return Colors.transparent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well and below:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated based on your review.
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a question for the future. Thanks for improving the docs.
| /// This supports different colors based on the [WidgetState]s of | ||
| /// the day button, such as `WidgetState.selected`, `WidgetState.hovered`, | ||
| /// `WidgetState.focused`, and `WidgetState.disabled`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we expect to add a comment like this on every WidgetStateProperty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good if we could clarify which WidgetStates are supported in doc:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, then should this comment be more precise instead of saying "such as"? That makes it seem like it might support other WidgetStates too.
Edit: Scratch that, in this case it's up to the app developer which states they're going to do anything with :)
68bceba to
fe97dd6
Compare
| /// if (states.contains(WidgetState.focused)) { | ||
| /// return Colors.blue.withOpacity(0.12); | ||
| /// } | ||
| /// return Colors.transparent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to do the same update here:) Colors.transparent is also fine. I just feel providing a null example contains more info.
flutter/flutter@3ed38e2...cfb887c 2025-04-20 [email protected] Roll Fuchsia Linux SDK from 0U_vEALFF7qRJZ_cE... to RGmU4KeQhrxqE7hsr... (flutter/flutter#167447) 2025-04-19 [email protected] Roll Skia from 3dc3ffeb45f0 to bd9ef4955aad (1 revision) (flutter/flutter#167434) 2025-04-19 [email protected] Roll Fuchsia Linux SDK from MwYckh5OvwwmIYLx0... to 0U_vEALFF7qRJZ_cE... (flutter/flutter#167430) 2025-04-19 [email protected] Roll Skia from 177a2929e32f to 3dc3ffeb45f0 (1 revision) (flutter/flutter#167428) 2025-04-19 [email protected] Revert "Reduce app startup latency by initializing the engine on a separate thread (#166918)" (flutter/flutter#167427) 2025-04-18 [email protected] Fix keyboard cover SearchAnchor list results (flutter/flutter#165382) 2025-04-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Mark `windows_host_engine_test` flaky (#167419)" (flutter/flutter#167425) 2025-04-18 [email protected] Docs: Update date picker theme day color properties doc (flutter/flutter#166122) 2025-04-18 [email protected] Add ktlint test for generated files from templates (flutter/flutter#167378) 2025-04-18 [email protected] Revert "[Windows] Enable merged platform and UI thread by default" (flutter/flutter#167420) 2025-04-18 [email protected] Add a DrivenScrollActivity.simulation constructor (flutter/flutter#166730) 2025-04-18 [email protected] Added missing period for consistency and readability (flutter/flutter#162887) 2025-04-18 [email protected] Roll Skia from 6c4595124690 to 177a2929e32f (1 revision) (flutter/flutter#167417) 2025-04-18 [email protected] Fix codesigning for `Mac_arm64_ios imitation_game_flutter` (flutter/flutter#167307) 2025-04-18 [email protected] Mark `windows_host_engine_test` flaky (flutter/flutter#167419) 2025-04-18 [email protected] Roll Dart SDK from ab60afc99bcb to 0cfefe2a03fb (1 revision) (flutter/flutter#167414) 2025-04-18 [email protected] [web] close input connection when window/iframe loses focus (flutter/flutter#166804) 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] 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#9118) flutter/flutter@3ed38e2...cfb887c 2025-04-20 [email protected] Roll Fuchsia Linux SDK from 0U_vEALFF7qRJZ_cE... to RGmU4KeQhrxqE7hsr... (flutter/flutter#167447) 2025-04-19 [email protected] Roll Skia from 3dc3ffeb45f0 to bd9ef4955aad (1 revision) (flutter/flutter#167434) 2025-04-19 [email protected] Roll Fuchsia Linux SDK from MwYckh5OvwwmIYLx0... to 0U_vEALFF7qRJZ_cE... (flutter/flutter#167430) 2025-04-19 [email protected] Roll Skia from 177a2929e32f to 3dc3ffeb45f0 (1 revision) (flutter/flutter#167428) 2025-04-19 [email protected] Revert "Reduce app startup latency by initializing the engine on a separate thread (#166918)" (flutter/flutter#167427) 2025-04-18 [email protected] Fix keyboard cover SearchAnchor list results (flutter/flutter#165382) 2025-04-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Mark `windows_host_engine_test` flaky (#167419)" (flutter/flutter#167425) 2025-04-18 [email protected] Docs: Update date picker theme day color properties doc (flutter/flutter#166122) 2025-04-18 [email protected] Add ktlint test for generated files from templates (flutter/flutter#167378) 2025-04-18 [email protected] Revert "[Windows] Enable merged platform and UI thread by default" (flutter/flutter#167420) 2025-04-18 [email protected] Add a DrivenScrollActivity.simulation constructor (flutter/flutter#166730) 2025-04-18 [email protected] Added missing period for consistency and readability (flutter/flutter#162887) 2025-04-18 [email protected] Roll Skia from 6c4595124690 to 177a2929e32f (1 revision) (flutter/flutter#167417) 2025-04-18 [email protected] Fix codesigning for `Mac_arm64_ios imitation_game_flutter` (flutter/flutter#167307) 2025-04-18 [email protected] Mark `windows_host_engine_test` flaky (flutter/flutter#167419) 2025-04-18 [email protected] Roll Dart SDK from ab60afc99bcb to 0cfefe2a03fb (1 revision) (flutter/flutter#167414) 2025-04-18 [email protected] [web] close input connection when window/iframe loses focus (flutter/flutter#166804) 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] 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#9118) flutter/flutter@3ed38e2...cfb887c 2025-04-20 [email protected] Roll Fuchsia Linux SDK from 0U_vEALFF7qRJZ_cE... to RGmU4KeQhrxqE7hsr... (flutter/flutter#167447) 2025-04-19 [email protected] Roll Skia from 3dc3ffeb45f0 to bd9ef4955aad (1 revision) (flutter/flutter#167434) 2025-04-19 [email protected] Roll Fuchsia Linux SDK from MwYckh5OvwwmIYLx0... to 0U_vEALFF7qRJZ_cE... (flutter/flutter#167430) 2025-04-19 [email protected] Roll Skia from 177a2929e32f to 3dc3ffeb45f0 (1 revision) (flutter/flutter#167428) 2025-04-19 [email protected] Revert "Reduce app startup latency by initializing the engine on a separate thread (#166918)" (flutter/flutter#167427) 2025-04-18 [email protected] Fix keyboard cover SearchAnchor list results (flutter/flutter#165382) 2025-04-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Mark `windows_host_engine_test` flaky (#167419)" (flutter/flutter#167425) 2025-04-18 [email protected] Docs: Update date picker theme day color properties doc (flutter/flutter#166122) 2025-04-18 [email protected] Add ktlint test for generated files from templates (flutter/flutter#167378) 2025-04-18 [email protected] Revert "[Windows] Enable merged platform and UI thread by default" (flutter/flutter#167420) 2025-04-18 [email protected] Add a DrivenScrollActivity.simulation constructor (flutter/flutter#166730) 2025-04-18 [email protected] Added missing period for consistency and readability (flutter/flutter#162887) 2025-04-18 [email protected] Roll Skia from 6c4595124690 to 177a2929e32f (1 revision) (flutter/flutter#167417) 2025-04-18 [email protected] Fix codesigning for `Mac_arm64_ios imitation_game_flutter` (flutter/flutter#167307) 2025-04-18 [email protected] Mark `windows_host_engine_test` flaky (flutter/flutter#167419) 2025-04-18 [email protected] Roll Dart SDK from ab60afc99bcb to 0cfefe2a03fb (1 revision) (flutter/flutter#167414) 2025-04-18 [email protected] [web] close input connection when window/iframe loses focus (flutter/flutter#166804) 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] 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#9118) flutter/flutter@3ed38e2...cfb887c 2025-04-20 [email protected] Roll Fuchsia Linux SDK from 0U_vEALFF7qRJZ_cE... to RGmU4KeQhrxqE7hsr... (flutter/flutter#167447) 2025-04-19 [email protected] Roll Skia from 3dc3ffeb45f0 to bd9ef4955aad (1 revision) (flutter/flutter#167434) 2025-04-19 [email protected] Roll Fuchsia Linux SDK from MwYckh5OvwwmIYLx0... to 0U_vEALFF7qRJZ_cE... (flutter/flutter#167430) 2025-04-19 [email protected] Roll Skia from 177a2929e32f to 3dc3ffeb45f0 (1 revision) (flutter/flutter#167428) 2025-04-19 [email protected] Revert "Reduce app startup latency by initializing the engine on a separate thread (#166918)" (flutter/flutter#167427) 2025-04-18 [email protected] Fix keyboard cover SearchAnchor list results (flutter/flutter#165382) 2025-04-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Mark `windows_host_engine_test` flaky (#167419)" (flutter/flutter#167425) 2025-04-18 [email protected] Docs: Update date picker theme day color properties doc (flutter/flutter#166122) 2025-04-18 [email protected] Add ktlint test for generated files from templates (flutter/flutter#167378) 2025-04-18 [email protected] Revert "[Windows] Enable merged platform and UI thread by default" (flutter/flutter#167420) 2025-04-18 [email protected] Add a DrivenScrollActivity.simulation constructor (flutter/flutter#166730) 2025-04-18 [email protected] Added missing period for consistency and readability (flutter/flutter#162887) 2025-04-18 [email protected] Roll Skia from 6c4595124690 to 177a2929e32f (1 revision) (flutter/flutter#167417) 2025-04-18 [email protected] Fix codesigning for `Mac_arm64_ios imitation_game_flutter` (flutter/flutter#167307) 2025-04-18 [email protected] Mark `windows_host_engine_test` flaky (flutter/flutter#167419) 2025-04-18 [email protected] Roll Dart SDK from ab60afc99bcb to 0cfefe2a03fb (1 revision) (flutter/flutter#167414) 2025-04-18 [email protected] [web] close input connection when window/iframe loses focus (flutter/flutter#166804) 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] 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#9118) flutter/flutter@3ed38e2...cfb887c 2025-04-20 [email protected] Roll Fuchsia Linux SDK from 0U_vEALFF7qRJZ_cE... to RGmU4KeQhrxqE7hsr... (flutter/flutter#167447) 2025-04-19 [email protected] Roll Skia from 3dc3ffeb45f0 to bd9ef4955aad (1 revision) (flutter/flutter#167434) 2025-04-19 [email protected] Roll Fuchsia Linux SDK from MwYckh5OvwwmIYLx0... to 0U_vEALFF7qRJZ_cE... (flutter/flutter#167430) 2025-04-19 [email protected] Roll Skia from 177a2929e32f to 3dc3ffeb45f0 (1 revision) (flutter/flutter#167428) 2025-04-19 [email protected] Revert "Reduce app startup latency by initializing the engine on a separate thread (#166918)" (flutter/flutter#167427) 2025-04-18 [email protected] Fix keyboard cover SearchAnchor list results (flutter/flutter#165382) 2025-04-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Mark `windows_host_engine_test` flaky (#167419)" (flutter/flutter#167425) 2025-04-18 [email protected] Docs: Update date picker theme day color properties doc (flutter/flutter#166122) 2025-04-18 [email protected] Add ktlint test for generated files from templates (flutter/flutter#167378) 2025-04-18 [email protected] Revert "[Windows] Enable merged platform and UI thread by default" (flutter/flutter#167420) 2025-04-18 [email protected] Add a DrivenScrollActivity.simulation constructor (flutter/flutter#166730) 2025-04-18 [email protected] Added missing period for consistency and readability (flutter/flutter#162887) 2025-04-18 [email protected] Roll Skia from 6c4595124690 to 177a2929e32f (1 revision) (flutter/flutter#167417) 2025-04-18 [email protected] Fix codesigning for `Mac_arm64_ios imitation_game_flutter` (flutter/flutter#167307) 2025-04-18 [email protected] Mark `windows_host_engine_test` flaky (flutter/flutter#167419) 2025-04-18 [email protected] Roll Dart SDK from ab60afc99bcb to 0cfefe2a03fb (1 revision) (flutter/flutter#167414) 2025-04-18 [email protected] [web] close input connection when window/iframe loses focus (flutter/flutter#166804) 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] 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Docs: Update date picker theme day color properties doc fixes: flutter#161052 Part 2 of flutter#164972 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. --------- Co-authored-by: Qun Cheng <[email protected]>
Docs: Update date picker theme day color properties doc
fixes: #161052
Part 2 of #164972
Pre-launch Checklist
///).