Skip to content

Conversation

@Gustl22
Copy link
Contributor

@Gustl22 Gustl22 commented Aug 3, 2025

The code for time picker involves ambiguous widget names, which makes understanding the widget structure more challenging.
I tried to use the namings of the M3 specs to make it a bit clearer.
This also removes a code section which is not needed, as the widget is only meant for "dial" and not "input" mode.

I didn't raise an issue, but I can, if that's still necessary.

This PR is test-exempt, as it doesn't add or fix any functionality.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Aug 3, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors several private widget names within the time picker to improve clarity, particularly for widgets used only in the dial entry mode. The new names like _TimePickerDialHeader and _DialHourControl are more descriptive. The removal of a redundant switch statement is also a good cleanup. However, the renaming of _HourControl and _MinuteControl will break existing tests in packages/flutter/test/material/time_picker_test.dart which look for these widgets by their old names. These tests need to be updated to reflect the new widget names.

@github-actions github-actions bot added the a: internationalization Supporting other languages or locales. (aka i18n) label Aug 3, 2025
@dkwingsmt dkwingsmt self-requested a review August 6, 2025 18:38
@dkwingsmt
Copy link
Contributor

I'm sorry I have not been able to review this PR. Will soon!

Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

Great change! LGTM except for a minor suggestion.

@Gustl22 Gustl22 requested a review from dkwingsmt September 6, 2025 09:22
Copy link
Contributor

@dkwingsmt dkwingsmt 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 the cleanup!

# Conflicts:
#	packages/flutter/test/material/time_picker_test.dart
@Gustl22 Gustl22 requested a review from victorsanni September 24, 2025 05:58
Copy link
Contributor

@victorsanni victorsanni left a comment

Choose a reason for hiding this comment

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

LGTM with a couple questions.


return SizedBox(
height: height,
height: defaultTheme.hourMinuteSize.height,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to test that this value is never defaultTheme.hourMinuteInputSize.height?

Copy link
Contributor Author

@Gustl22 Gustl22 Sep 25, 2025

Choose a reason for hiding this comment

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

I don't think that's what we want.
defaultTheme.hourMinuteInputSize.height could be equal to defaultTheme.hourMinuteSize.height. I didn`t look up the values, but in any future material design version, this may is the case and should be tweakable (in my opinion). Besides that any change should be detectable through golden tests anyways.


@override
Widget build(BuildContext context) {
assert(_debugDialTimePickerEntryMode(context));
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to test the asserts (or they are never triggered)?

Copy link
Contributor Author

@Gustl22 Gustl22 Sep 25, 2025

Choose a reason for hiding this comment

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

You mean, if they actually work? I don't see a case there they can be triggered by the user as they are all present in a private class and only called internally in dial mode. We could open the classes for testing and intentionally set the wrong mode, if that's something what we want (?)
But also I don't see this very critical and only as help for contributors.

Copy link
Contributor

@victorsanni victorsanni 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 change.

@victorsanni victorsanni added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 25, 2025
@Gustl22
Copy link
Contributor Author

Gustl22 commented Sep 25, 2025

Thank you for reviewing!

@auto-submit auto-submit bot added this pull request to the merge queue Sep 25, 2025
Merged via the queue into flutter:master with commit aa56148 Sep 25, 2025
79 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 27, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 27, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 29, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 29, 2025
…10116)

Manual roll requested by [email protected]

flutter/flutter@b1a28bc...6cc976e

2025-09-25 [email protected] [Impeller] Optimize scale translate rectangle transforms (flutter/flutter#171841)
2025-09-25 [email protected] [time_picker] refactor: Distinguish widgets for dial mode only (flutter/flutter#173188)
2025-09-25 [email protected] Reapply "Update the AccessibilityPlugin::Announce method to account f… (flutter/flutter#174365)
2025-09-25 [email protected] Put Linux firebase_release_smoke_test on bringup (flutter/flutter#176043)

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] 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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…er#173188)

The code for time picker involves ambiguous widget names, which makes
understanding the widget structure more challenging.
I tried to use the namings of the [M3
specs](https://m3.material.io/components/time-pickers/specs) to make it
a bit clearer.
This also removes a code section which is not needed, as the widget is
only meant for "dial" and not "input" mode.

I didn't raise an issue, but I can, if that's still necessary.

This PR is test-exempt, as it doesn't add or fix any functionality.

## 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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] 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].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Victor Sanni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: internationalization Supporting other languages or locales. (aka i18n) f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants