Skip to content

Manually roll material_color_utilities #170000

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

kevmoo
Copy link
Contributor

@kevmoo kevmoo commented Jun 4, 2025

This updates Flutter to the latest release, which includes a bunch of code cleanup that should improve compiled code size and (hopefully) runtime performance.

The changes in #153385 (discussed in https://docs.flutter.dev/release/breaking-changes/material-design-3-token-update) seem to have been incomplete.

This PR effectively catches up with these changes by updating the "math" behind primary, secondary, tertiary, error colors.

There is a pending PR on the site to update the corresponding docs: flutter/website#12125

@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. labels Jun 4, 2025
@kevmoo kevmoo requested a review from matanlurey June 4, 2025 16:58
@kevmoo kevmoo added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 4, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 4, 2025
Copy link
Contributor

auto-submit bot commented Jun 4, 2025

autosubmit label was removed for flutter/flutter/170000, because - The status or check suite Windows framework_tests_libraries has failed. Please fix the issues identified (or deflake) before re-applying this label.

@github-actions github-actions bot added the f: material design flutter/packages/flutter/material repository. label Jun 4, 2025
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

This will need to be rolled up in a guide on the website for users that won't want these colors to change out from under them. See similar doc on the website linked below.

Also cc @QuncCccccc

@kevmoo
Copy link
Contributor Author

kevmoo commented Jun 4, 2025

I almost want to make a branch on material at the last merge and apply the fixes so we don't have to throw the baby out with the bath water.

Will ponder...

@kevmoo kevmoo marked this pull request as draft June 4, 2025 19:50
@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@kevmoo kevmoo marked this pull request as ready for review June 11, 2025 22:36
@kevmoo
Copy link
Contributor Author

kevmoo commented Jun 11, 2025

@Piinks – so, this is interesting. I've updated the description of this PR.

The changes made in August seem to have been only half of the changes to make things consistent. This is the other half of the changes that align with the Aug 2024 update.

https://m3.material.io/styles/color/system/overview#785757d4-691b-45dd-b5dc-9d53ec6fbdbf

Specifically these changes: material-foundation/material-color-utilities@03336bf#diff-f0d491177f9e42cf45baea3a37a1694c493d60d17855101af426848634d410eb

@kevmoo
Copy link
Contributor Author

kevmoo commented Jun 11, 2025

FYI: this change does drop the code size of the material sample (minified, uncompressed JS) around ~2k. The changes eliminated several dynamic calls and make things final which allows more more optimization in the compiler

@Piinks
Copy link
Contributor

Piinks commented Jun 12, 2025

Ok! All that needs doing IMO is creating a one pager on the website to help folks maintain the colors they have when this reaches stable and breaks them. I shared an example above.

@kevmoo
Copy link
Contributor Author

kevmoo commented Jun 12, 2025

@Piinks happy to help, BUT I'm a bit confused how to do it. See the linked diff from the repo. It's not a matter of switching color A for color B. The algorithm used to calculate colors changed.

If I understand correctly, the color roll we did in the fall left us out of sync w/ the algorithm change being brought in here.

kevmoo added a commit to flutter/website that referenced this pull request Jun 13, 2025
This aligns the docs with the changes in
flutter/flutter#170000
@kevmoo
Copy link
Contributor Author

kevmoo commented Jun 16, 2025

@Piinks – FYI/interesting - no goldens are affected here? Hrm...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants