Sitelet https://github.com/flutter/packages/pull/12469
Skip to content

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

Merged
auto-submit[bot] merged 17 commits into
flutter:mainfrom
elliette:migrate-pr-11762
Aug 25, 2026
Merged

auto-submit[bot] merged 17 commits into
flutter:mainfrom
elliette:migrate-pr-11762

Conversation

@elliette

@elliette elliette commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Work towards flutter/flutter#186906, flutter/flutter#191088

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

Since CI was not set up to run on that branch, I've pushed up a few more changes after the ported commits to get all the repo checks/tests to pass.

Original PR description

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.

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

@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!

@Piinks Piinks added triage-design Should be looked at in design triage and removed triage-framework Should be looked at in framework triage labels Aug 17, 2026
@github-actions github-actions Bot added the triage-framework Should be looked at in framework triage label Aug 17, 2026
@elliette

Copy link
Copy Markdown
Member Author

@stuartmorgan-g do you mind checking if this directory structure looks good to you? Thanks!

@Piinks Piinks removed the triage-framework Should be looked at in framework triage label Aug 17, 2026
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 the triage-framework Should be looked at in framework triage label Aug 19, 2026
@elliette elliette added the override: no versioning needed Override the check requiring version bumps for most changes label Aug 19, 2026
@elliette

Copy link
Copy Markdown
Member Author

Added versioning exemption since these files are all in the /tool subdirectory that will be excluded from publishing. I'm not sure if this change even should have a changelog entry or if I should remove it as well.

@github-actions github-actions Bot removed the triage-framework Should be looked at in framework triage label Aug 20, 2026
@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Added versioning exemption since these files are all in the /tool subdirectory that will be excluded from publishing. I'm not sure if this change even should have a changelog entry or if I should remove it as well.

It shouldn't have a changelog entry, since tool/ is only for package developers. Our tooling already knowns not to flag it, so what I'm pretty sure is happening is that the .pubignore file is triggering this. We should add that to the dev-only file list in the tooling as well, and then this won't need a changelog entry or any override labels.

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Having everything encapsulated in the tool/ directory LGTM! (I didn't review the Dart code itself.)

Comment thread packages/material_ui/.pubignore Outdated
@@ -0,0 +1,2 @@
# The tool/ directory is for package developer use only and should not be published.
tool/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

According to the docs, having .pubignore will cause .gitignore to be ignored, so I believe you'll need to duplicate the .gitignore contents into this file to avoid issues the next time the package is published.

@elliette elliette Aug 24, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah, I did not know that! I moved the .pubignore under material_ui/tool/ instead, that way we don't have to keep the contents of it and material_ui's .gitignore file in-sync. I did a test run with dart pub publish --dry-run to confirm that the tool directory is excluded.

@elliette elliette added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 25, 2026
@auto-submit
auto-submit Bot merged commit 3213414 into flutter:main Aug 25, 2026
13 checks passed
danielleon-cmd pushed a commit to victogomez-cs/packages-fork that referenced this pull request Aug 27, 2026
Work towards flutter/flutter#186906, flutter/flutter#191088

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

Since CI was not set up to run on that branch, I've pushed up a few more changes after the ported commits to get all the repo checks/tests to pass.

### Original PR description
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.

## Pre-Review Checklist

**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.
bkonyi pushed a commit to bkonyi/flutter that referenced this pull request Aug 27, 2026
…r#191886)

flutter/packages@740f093...bd3cbc1

2026-08-26 engine-flutter-autoroll@skia.org Roll Flutter from
9a82789 to 15d8908 (37 revisions) (flutter/packages#12619)
2026-08-26 stuartmorgan@google.com [google_maps_flutter] Convert simple
object controllers to Swift (flutter/packages#12618)
2026-08-26 21270878+elliette@users.noreply.github.com [material_ui]
`gen_defaults` should follow new versioning strategy
(flutter/packages#12627)
2026-08-25 10687576+bparrishMines@users.noreply.github.com [material_ui]
Fixes analysis_options migration from calling `flutter pub get` on
pacakage (flutter/packages#12626)
2026-08-25 jason-simmons@users.noreply.github.com [material_ui] Declare
Flutter SDK dependencies in the pubspec.yaml for tool/gen_defaults
(flutter/packages#12623)
2026-08-25 21270878+elliette@users.noreply.github.com [material_ui]
Set-up `tool/gen_defaults` sub-directory (flutter/packages#12469)
2026-08-25 stuartmorgan@google.com [google_maps_flutter] Convert
top-level classes to Swift in `_sdk*` packages (flutter/packages#12307)

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-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
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
jagadeesh8682 pushed a commit to jagadeesh8682/packages that referenced this pull request Sep 2, 2026
Work towards flutter/flutter#186906, flutter/flutter#191088

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

Since CI was not set up to run on that branch, I've pushed up a few more changes after the ported commits to get all the repo checks/tests to pass.

### Original PR description
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.

## Pre-Review Checklist

**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.
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 CICD Run CI/CD override: no versioning needed Override the check requiring version bumps for most changes p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants