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

Update hourMinuteTextStyle defaults for Material 3 Time Picker #143749

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

TahaTesser
Copy link
Member

fixes hourMinuteTextStyle Material 3 default doesn't match the specs

This updates hourMinuteTextStyle defaults to match Material 3 specs. hourMinuteTextStyle should use different font style for different entry modes based on the specs.

Specs

Screenshot 2024-02-20 at 15 06 40
Screenshot 2024-02-20 at 15 07 22

Before

 return _textTheme.displayMedium!.copyWith(color: _hourMinuteTextColor.resolve(states));

After

      return entryMode == TimePickerEntryMode.dial
        ? _textTheme.displayLarge!.copyWith(color: _hourMinuteTextColor.resolve(states))
        : _textTheme.displayMedium!.copyWith(color: _hourMinuteTextColor.resolve(states));

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.

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

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Feb 20, 2024
@TahaTesser TahaTesser marked this pull request as ready for review February 20, 2024 14:47
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@@ -3612,7 +3613,9 @@ class _TimePickerDefaultsM3 extends _TimePickerDefaults {
// TODO(tahatesser): Update this when https://github.com/flutter/flutter/issues/131247 is fixed.
// This is using the correct text style from Material 3 spec.
// https://m3.material.io/components/time-pickers/specs#fd0b6939-edab-4058-82e1-93d163945215
return _textTheme.displayMedium!.copyWith(color: _hourMinuteTextColor.resolve(states));
return entryMode == TimePickerEntryMode.dial
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make this a switch instead, so that if we add more modes it will flag it.

Copy link
Member Author

@TahaTesser TahaTesser Feb 21, 2024

Choose a reason for hiding this comment

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

Thank you so much! This actually saved me from making mistake. I totally forgot to handle dialOnly and inputOnly modes.

Now it will look like this:

      return switch (entryMode) {
        TimePickerEntryMode.dial || TimePickerEntryMode.dialOnly
          => _textTheme.displayLarge!.copyWith(color: _hourMinuteTextColor.resolve(states)),
        TimePickerEntryMode.input || TimePickerEntryMode.inputOnly
          => _textTheme.displayMedium!.copyWith(color: _hourMinuteTextColor.resolve(states)),
      };

dev/tools/gen_defaults/lib/time_picker_template.dart Outdated Show resolved Hide resolved
@TahaTesser TahaTesser force-pushed the update_hourMinuteTextStyle_m3 branch from 6653206 to 5a9f94f Compare February 21, 2024 08:56
@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 21, 2024
@auto-submit auto-submit bot merged commit 3403ca4 into flutter:master Feb 21, 2024
133 checks passed
@TahaTesser TahaTesser deleted the update_hourMinuteTextStyle_m3 branch February 21, 2024 10:41
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 21, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 21, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 21, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 21, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 22, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 22, 2024
Manual roll Flutter from 5129806 to efee280 (47 revisions)

Manual roll requested by [email protected]

flutter/flutter@5129806...efee280

2024-02-22 [email protected] Roll Flutter Engine from bf5c003085fd to 7eeb697687d5 (16 revisions) (flutter/flutter#143911)
2024-02-22 [email protected] Update PR template for dart fix (flutter/flutter#143879)
2024-02-22 [email protected] Re-use methods to calculate leading and trailing garbage in RenderSliverMultiBoxAdaptor (flutter/flutter#143884)
2024-02-21 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] Make impeller goldens test blocking. (#143864)" (flutter/flutter#143896)
2024-02-21 [email protected] [Impeller] Make impeller goldens test blocking. (flutter/flutter#143864)
2024-02-21 [email protected] Disable color filter sepia test for Impeller. (flutter/flutter#143861)
2024-02-21 [email protected] Roll Flutter Engine from 52ffcaadea41 to bf5c003085fd (12 revisions) (flutter/flutter#143875)
2024-02-21 [email protected] Roll Flutter Engine from 4128895d79a1 to 52ffcaadea41 (1 revision) (flutter/flutter#143862)
2024-02-21 [email protected] Deprecate redundant itemExtent in RenderSliverFixedExtentBoxAdaptor methods (flutter/flutter#143412)
2024-02-21 [email protected] Add aab as alias for appbundle (flutter/flutter#143855)
2024-02-21 [email protected] Roll Flutter Engine from e16f43eeaaa4 to 4128895d79a1 (1 revision) (flutter/flutter#143856)
2024-02-21 [email protected] Roll Packages from 8bba41b to 48048f6 (2 revisions) (flutter/flutter#143853)
2024-02-21 [email protected] Update `hourMinuteTextStyle` defaults for Material 3 Time Picker (flutter/flutter#143749)
2024-02-21 [email protected] Roll Flutter Engine from 93063f61943a to e16f43eeaaa4 (2 revisions) (flutter/flutter#143827)
2024-02-21 [email protected] Roll Flutter Engine from ed49634486e9 to 93063f61943a (1 revision) (flutter/flutter#143826)
2024-02-21 [email protected] `CalendarDatePicker` doesn't announce selected date on desktop (flutter/flutter#143583)
2024-02-21 [email protected] Roll Flutter Engine from 9100d326475a to ed49634486e9 (2 revisions) (flutter/flutter#143824)
2024-02-21 [email protected] Add `timeSelectorSeparatorColor` and `timeSelectorSeparatorTextStyle`  for Material 3 Time Picker (flutter/flutter#143739)
2024-02-21 [email protected] Roll Flutter Engine from efc69946cb1e to 9100d326475a (2 revisions) (flutter/flutter#143820)
2024-02-21 [email protected] Roll Flutter Engine from 700250436e3f to efc69946cb1e (2 revisions) (flutter/flutter#143816)
2024-02-21 [email protected] Roll Flutter Engine from 3557277c575c to 700250436e3f (1 revision) (flutter/flutter#143814)
2024-02-21 [email protected] more fixes to unstable impeller goldens. (flutter/flutter#143811)
2024-02-21 [email protected] Roll Flutter Engine from cb12a8cc97a1 to 3557277c575c (2 revisions) (flutter/flutter#143807)
2024-02-21 [email protected] [flutter_tools] enable wasm compile on beta channel (flutter/flutter#143779)
2024-02-21 [email protected] Fix initialization of time in repeat on AnimationController (flutter/flutter#142887)
2024-02-21 [email protected] Disable debug banner to stabilize impeller goldens. (flutter/flutter#143794)
2024-02-21 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (#143281)" (flutter/flutter#143801)
2024-02-20 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add UI Benchmarks (#143542)" (flutter/flutter#143798)
2024-02-20 [email protected] Avoid applying partial dartfixes on CI (flutter/flutter#143551)
2024-02-20 [email protected] Add UI Benchmarks (flutter/flutter#143542)
2024-02-20 [email protected] Roll Flutter Engine from 1ae2c10e8071 to cb12a8cc97a1 (1 revision) (flutter/flutter#143791)
2024-02-20 [email protected] Implement `_suspendedNode` fix (flutter/flutter#143556)
2024-02-20 [email protected] Change `ItemExtentBuilder`'s return value nullable (flutter/flutter#142428)
2024-02-20 [email protected] Roll Flutter Engine from 27828054f07a to 1ae2c10e8071 (6 revisions) (flutter/flutter#143783)
2024-02-20 [email protected] Roll Flutter Engine from e16a260265ad to 27828054f07a (1 revision) (flutter/flutter#143769)
2024-02-20 [email protected] [gold] Always provide host ABI to gold config (flutter/flutter#143621)
2024-02-20 [email protected] instead of exiting the tool, print a warning when using --flavor with an incompatible device (flutter/flutter#143735)
2024-02-20 [email protected] Implementing `switch` expressions: everything in `flutter/lib/src/` (flutter/flutter#143634)
2024-02-20 [email protected] Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (flutter/flutter#143281)
2024-02-20 [email protected] Delete local.properties that shouldn't have been pushed (flutter/flutter#143774)
2024-02-20 [email protected] Clean leaks. (flutter/flutter#142818)
2024-02-20 [email protected] Introduce tone-based surfaces and accent color add-ons - Part 2 (flutter/flutter#138521)
2024-02-20 [email protected] Explain when and why to use CrossAxisAlignment.baseline (flutter/flutter#143632)
2024-02-20 [email protected] Roll Flutter Engine from a41da3701923 to e16a260265ad (2 revisions) (flutter/flutter#143763)
...
LouiseHsu pushed a commit to LouiseHsu/packages that referenced this pull request Mar 7, 2024
)

Manual roll Flutter from 5129806 to efee280 (47 revisions)

Manual roll requested by [email protected]

flutter/flutter@5129806...efee280

2024-02-22 [email protected] Roll Flutter Engine from bf5c003085fd to 7eeb697687d5 (16 revisions) (flutter/flutter#143911)
2024-02-22 [email protected] Update PR template for dart fix (flutter/flutter#143879)
2024-02-22 [email protected] Re-use methods to calculate leading and trailing garbage in RenderSliverMultiBoxAdaptor (flutter/flutter#143884)
2024-02-21 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] Make impeller goldens test blocking. (#143864)" (flutter/flutter#143896)
2024-02-21 [email protected] [Impeller] Make impeller goldens test blocking. (flutter/flutter#143864)
2024-02-21 [email protected] Disable color filter sepia test for Impeller. (flutter/flutter#143861)
2024-02-21 [email protected] Roll Flutter Engine from 52ffcaadea41 to bf5c003085fd (12 revisions) (flutter/flutter#143875)
2024-02-21 [email protected] Roll Flutter Engine from 4128895d79a1 to 52ffcaadea41 (1 revision) (flutter/flutter#143862)
2024-02-21 [email protected] Deprecate redundant itemExtent in RenderSliverFixedExtentBoxAdaptor methods (flutter/flutter#143412)
2024-02-21 [email protected] Add aab as alias for appbundle (flutter/flutter#143855)
2024-02-21 [email protected] Roll Flutter Engine from e16f43eeaaa4 to 4128895d79a1 (1 revision) (flutter/flutter#143856)
2024-02-21 [email protected] Roll Packages from 8bba41b to 48048f6 (2 revisions) (flutter/flutter#143853)
2024-02-21 [email protected] Update `hourMinuteTextStyle` defaults for Material 3 Time Picker (flutter/flutter#143749)
2024-02-21 [email protected] Roll Flutter Engine from 93063f61943a to e16f43eeaaa4 (2 revisions) (flutter/flutter#143827)
2024-02-21 [email protected] Roll Flutter Engine from ed49634486e9 to 93063f61943a (1 revision) (flutter/flutter#143826)
2024-02-21 [email protected] `CalendarDatePicker` doesn't announce selected date on desktop (flutter/flutter#143583)
2024-02-21 [email protected] Roll Flutter Engine from 9100d326475a to ed49634486e9 (2 revisions) (flutter/flutter#143824)
2024-02-21 [email protected] Add `timeSelectorSeparatorColor` and `timeSelectorSeparatorTextStyle`  for Material 3 Time Picker (flutter/flutter#143739)
2024-02-21 [email protected] Roll Flutter Engine from efc69946cb1e to 9100d326475a (2 revisions) (flutter/flutter#143820)
2024-02-21 [email protected] Roll Flutter Engine from 700250436e3f to efc69946cb1e (2 revisions) (flutter/flutter#143816)
2024-02-21 [email protected] Roll Flutter Engine from 3557277c575c to 700250436e3f (1 revision) (flutter/flutter#143814)
2024-02-21 [email protected] more fixes to unstable impeller goldens. (flutter/flutter#143811)
2024-02-21 [email protected] Roll Flutter Engine from cb12a8cc97a1 to 3557277c575c (2 revisions) (flutter/flutter#143807)
2024-02-21 [email protected] [flutter_tools] enable wasm compile on beta channel (flutter/flutter#143779)
2024-02-21 [email protected] Fix initialization of time in repeat on AnimationController (flutter/flutter#142887)
2024-02-21 [email protected] Disable debug banner to stabilize impeller goldens. (flutter/flutter#143794)
2024-02-21 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (#143281)" (flutter/flutter#143801)
2024-02-20 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add UI Benchmarks (#143542)" (flutter/flutter#143798)
2024-02-20 [email protected] Avoid applying partial dartfixes on CI (flutter/flutter#143551)
2024-02-20 [email protected] Add UI Benchmarks (flutter/flutter#143542)
2024-02-20 [email protected] Roll Flutter Engine from 1ae2c10e8071 to cb12a8cc97a1 (1 revision) (flutter/flutter#143791)
2024-02-20 [email protected] Implement `_suspendedNode` fix (flutter/flutter#143556)
2024-02-20 [email protected] Change `ItemExtentBuilder`'s return value nullable (flutter/flutter#142428)
2024-02-20 [email protected] Roll Flutter Engine from 27828054f07a to 1ae2c10e8071 (6 revisions) (flutter/flutter#143783)
2024-02-20 [email protected] Roll Flutter Engine from e16a260265ad to 27828054f07a (1 revision) (flutter/flutter#143769)
2024-02-20 [email protected] [gold] Always provide host ABI to gold config (flutter/flutter#143621)
2024-02-20 [email protected] instead of exiting the tool, print a warning when using --flavor with an incompatible device (flutter/flutter#143735)
2024-02-20 [email protected] Implementing `switch` expressions: everything in `flutter/lib/src/` (flutter/flutter#143634)
2024-02-20 [email protected] Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (flutter/flutter#143281)
2024-02-20 [email protected] Delete local.properties that shouldn't have been pushed (flutter/flutter#143774)
2024-02-20 [email protected] Clean leaks. (flutter/flutter#142818)
2024-02-20 [email protected] Introduce tone-based surfaces and accent color add-ons - Part 2 (flutter/flutter#138521)
2024-02-20 [email protected] Explain when and why to use CrossAxisAlignment.baseline (flutter/flutter#143632)
2024-02-20 [email protected] Roll Flutter Engine from a41da3701923 to e16a260265ad (2 revisions) (flutter/flutter#143763)
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
)

Manual roll Flutter from 5129806 to efee280 (47 revisions)

Manual roll requested by [email protected]

flutter/flutter@5129806...efee280

2024-02-22 [email protected] Roll Flutter Engine from bf5c003085fd to 7eeb697687d5 (16 revisions) (flutter/flutter#143911)
2024-02-22 [email protected] Update PR template for dart fix (flutter/flutter#143879)
2024-02-22 [email protected] Re-use methods to calculate leading and trailing garbage in RenderSliverMultiBoxAdaptor (flutter/flutter#143884)
2024-02-21 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] Make impeller goldens test blocking. (#143864)" (flutter/flutter#143896)
2024-02-21 [email protected] [Impeller] Make impeller goldens test blocking. (flutter/flutter#143864)
2024-02-21 [email protected] Disable color filter sepia test for Impeller. (flutter/flutter#143861)
2024-02-21 [email protected] Roll Flutter Engine from 52ffcaadea41 to bf5c003085fd (12 revisions) (flutter/flutter#143875)
2024-02-21 [email protected] Roll Flutter Engine from 4128895d79a1 to 52ffcaadea41 (1 revision) (flutter/flutter#143862)
2024-02-21 [email protected] Deprecate redundant itemExtent in RenderSliverFixedExtentBoxAdaptor methods (flutter/flutter#143412)
2024-02-21 [email protected] Add aab as alias for appbundle (flutter/flutter#143855)
2024-02-21 [email protected] Roll Flutter Engine from e16f43eeaaa4 to 4128895d79a1 (1 revision) (flutter/flutter#143856)
2024-02-21 [email protected] Roll Packages from 8bba41b to 48048f6 (2 revisions) (flutter/flutter#143853)
2024-02-21 [email protected] Update `hourMinuteTextStyle` defaults for Material 3 Time Picker (flutter/flutter#143749)
2024-02-21 [email protected] Roll Flutter Engine from 93063f61943a to e16f43eeaaa4 (2 revisions) (flutter/flutter#143827)
2024-02-21 [email protected] Roll Flutter Engine from ed49634486e9 to 93063f61943a (1 revision) (flutter/flutter#143826)
2024-02-21 [email protected] `CalendarDatePicker` doesn't announce selected date on desktop (flutter/flutter#143583)
2024-02-21 [email protected] Roll Flutter Engine from 9100d326475a to ed49634486e9 (2 revisions) (flutter/flutter#143824)
2024-02-21 [email protected] Add `timeSelectorSeparatorColor` and `timeSelectorSeparatorTextStyle`  for Material 3 Time Picker (flutter/flutter#143739)
2024-02-21 [email protected] Roll Flutter Engine from efc69946cb1e to 9100d326475a (2 revisions) (flutter/flutter#143820)
2024-02-21 [email protected] Roll Flutter Engine from 700250436e3f to efc69946cb1e (2 revisions) (flutter/flutter#143816)
2024-02-21 [email protected] Roll Flutter Engine from 3557277c575c to 700250436e3f (1 revision) (flutter/flutter#143814)
2024-02-21 [email protected] more fixes to unstable impeller goldens. (flutter/flutter#143811)
2024-02-21 [email protected] Roll Flutter Engine from cb12a8cc97a1 to 3557277c575c (2 revisions) (flutter/flutter#143807)
2024-02-21 [email protected] [flutter_tools] enable wasm compile on beta channel (flutter/flutter#143779)
2024-02-21 [email protected] Fix initialization of time in repeat on AnimationController (flutter/flutter#142887)
2024-02-21 [email protected] Disable debug banner to stabilize impeller goldens. (flutter/flutter#143794)
2024-02-21 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (#143281)" (flutter/flutter#143801)
2024-02-20 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add UI Benchmarks (#143542)" (flutter/flutter#143798)
2024-02-20 [email protected] Avoid applying partial dartfixes on CI (flutter/flutter#143551)
2024-02-20 [email protected] Add UI Benchmarks (flutter/flutter#143542)
2024-02-20 [email protected] Roll Flutter Engine from 1ae2c10e8071 to cb12a8cc97a1 (1 revision) (flutter/flutter#143791)
2024-02-20 [email protected] Implement `_suspendedNode` fix (flutter/flutter#143556)
2024-02-20 [email protected] Change `ItemExtentBuilder`'s return value nullable (flutter/flutter#142428)
2024-02-20 [email protected] Roll Flutter Engine from 27828054f07a to 1ae2c10e8071 (6 revisions) (flutter/flutter#143783)
2024-02-20 [email protected] Roll Flutter Engine from e16a260265ad to 27828054f07a (1 revision) (flutter/flutter#143769)
2024-02-20 [email protected] [gold] Always provide host ABI to gold config (flutter/flutter#143621)
2024-02-20 [email protected] instead of exiting the tool, print a warning when using --flavor with an incompatible device (flutter/flutter#143735)
2024-02-20 [email protected] Implementing `switch` expressions: everything in `flutter/lib/src/` (flutter/flutter#143634)
2024-02-20 [email protected] Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (flutter/flutter#143281)
2024-02-20 [email protected] Delete local.properties that shouldn't have been pushed (flutter/flutter#143774)
2024-02-20 [email protected] Clean leaks. (flutter/flutter#142818)
2024-02-20 [email protected] Introduce tone-based surfaces and accent color add-ons - Part 2 (flutter/flutter#138521)
2024-02-20 [email protected] Explain when and why to use CrossAxisAlignment.baseline (flutter/flutter#143632)
2024-02-20 [email protected] Roll Flutter Engine from a41da3701923 to e16a260265ad (2 revisions) (flutter/flutter#143763)
...
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: 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.

hourMinuteTextStyle Material 3 default doesn't match the specs
2 participants