Skip to content

[material_ui] Set-up tool/gen_defaults sub-directory - #12469

Open
elliette wants to merge 4 commits into
flutter:mainfrom
elliette:migrate-pr-11762
Open

[material_ui] Set-up tool/gen_defaults sub-directory#12469
elliette wants to merge 4 commits into
flutter:mainfrom
elliette:migrate-pr-11762

Conversation

@elliette

@elliette elliette commented Aug 13, 2026

Copy link
Copy Markdown
Member

Ports over #11762 which landed on the m3e_migration feature branch.

Adds the initial gen_defaults sub-directory with the initial TokenTemplate and generator. This is simply the initial scaffold, we will need to add additional helper functions as necessary as we begin adding the actual templates.

Work towards flutter/flutter#186906

Pre-Review 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.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

Work towards flutter/flutter#186906

Adds the initial `gen_defaults` sub-directory with the initial
`TokenTemplate` and generator. This is simply the initial scaffold, we
will need to add additional helper functions as necessary as we begin
adding the actual templates.

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] page, which explains my
responsibilities.
- [x] I read and followed the [relevant style guides] and ran [the
auto-formatter].
- [x] I signed the [CLA].
- [x] The title of the PR starts with the name of the package surrounded
by square brackets, e.g. `[shared_preferences]`
- [x] I [linked to at least one issue that this PR fixes] in the
description above.
- [x] I followed [the version and CHANGELOG instructions], using
[semantic versioning] and the [repository CHANGELOG style], or I have
commented below to indicate which documented exception this PR falls
under[^1].
- [x] I updated/added any relevant documentation (doc comments with
`///`).
- [x] I added new tests to check the change I am making, or I have
commented below to indicate which [test exemption] this PR falls
under[^1].
- [ ] 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.

[^1]: Regular contributors who have demonstrated familiarity with the
repository guidelines only need to comment if the PR is not
auto-exempted by repo tooling.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[relevant style guides]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style
[the auto-formatter]:
https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code
[CLA]: https://cla.developers.google.com/
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[linked to at least one issue that this PR fixes]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[the version and CHANGELOG instructions]:
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates
[semantic versioning]:
https://dart.dev/tools/pub/versioning#semantic-versions
[repository CHANGELOG style]:
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style
[test exemption]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels Aug 13, 2026
@elliette elliette added the CICD Run CI/CD label Aug 13, 2026
@elliette
elliette marked this pull request as ready for review August 13, 2026 22:06
@elliette
elliette requested a review from QuncCccccc August 13, 2026 22:06

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

Copy link
Copy Markdown
Contributor

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 introduces a new gen_defaults tool under packages/material_ui/tool/gen_defaults to generate Material component theme data defaults from token data. It includes the generator script, base template classes, configuration files, and tests. Feedback suggests improving the robustness of the path resolution in materialLib by resolving paths relative to Platform.script instead of relying on the current working directory.

Comment thread packages/material_ui/tool/gen_defaults/templates/template.dart

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD p: material_ui triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants