Repository navigation
[material_ui] gen_defaults should follow new versioning strategy - #12627
Conversation
Work towards flutter/flutter#186906 Work towards flutter/flutter#187899 Previously, the `gen_defaults` script generated the files in different directories based on whether or not the template was an M3 or M3E template. Since we are planning on using an variant enum instead of different libraries to separate M3 and M3E implementations, the `gen_defaults` script needs to be accordingly updated. **Before:** ``` lib/src/ ├── button.dart ← Editable M3 parent file ├── material_3_expressive/ │ └── button.dart ← Editable M3E parent file └── generated/ ├── button_defaults.g.dart ← Generated M3 part file └── material_3_expressive/ └── button_defaults.g.dart ← Generated M3E part file ``` **After:** ``` lib/src/ ├── button.dart ← Editable M3/M3E parent file └── generated/ ├── button_m3_defaults.g.dart ← Generated M3 part file └── button_m3e_defaults.g.dart ← Generated M3E part file ``` The template now creates the generated class name as well, either `M3NameDefaults` or `M3ENameDefaults` (e.g. `M3EButtonDefaults`). ## Pre-Review Checklist - [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
gen_defaults should follow new versioning strategygen_defaults should follow new versioning strategy
There was a problem hiding this comment.
Code Review
This pull request refactors the Material 3 and Material 3 Expressive defaults generator template structure, introducing dynamic class name generation, validation assertions, and updated file naming conventions. Tests are updated to cover both template types and new validation checks. A review comment suggests improving the robustness of resolving the Dart executable for formatting on Windows by checking Platform.resolvedExecutable before falling back to dart.bat or dart.
|
Detected the If you add the The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue". |
|
Why was the emergency tag added to this PR? |
It contains a fix for a tree breakage caused by #12469 (discussed in offline chat with @bparrishMines who is the current gardener): Fix is the change to how we invoke the formatter in this PR: a50e83b (For some reason, we are seeing post-submit failures for #12469 that weren't caught in the pre-submit checks. But that is a separate issue I'm looking into!) |
…lutter#12627) Work towards flutter/flutter#191088 **Ports over flutter#11918 which landed on the `m3e_migration` feature branch.** ### Original PR description Work towards flutter/flutter#186906 Work towards flutter/flutter#187899 Previously, the `gen_defaults` script generated the files in different directories based on whether or not the template was an M3 or M3E template. Since we are planning on using an variant enum instead of different libraries to separate M3 and M3E implementations, the `gen_defaults` script needs to be accordingly updated. ## 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.
…r#191886) flutter/packages@740f093...bd3cbc1 2026-08-26 [email protected] Roll Flutter from 9a82789 to 15d8908 (37 revisions) (flutter/packages#12619) 2026-08-26 [email protected] [google_maps_flutter] Convert simple object controllers to Swift (flutter/packages#12618) 2026-08-26 [email protected] [material_ui] `gen_defaults` should follow new versioning strategy (flutter/packages#12627) 2026-08-25 [email protected] [material_ui] Fixes analysis_options migration from calling `flutter pub get` on pacakage (flutter/packages#12626) 2026-08-25 [email protected] [material_ui] Declare Flutter SDK dependencies in the pubspec.yaml for tool/gen_defaults (flutter/packages#12623) 2026-08-25 [email protected] [material_ui] Set-up `tool/gen_defaults` sub-directory (flutter/packages#12469) 2026-08-25 [email protected] [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 [email protected] 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
…lutter#12627) Work towards flutter/flutter#191088 **Ports over flutter#11918 which landed on the `m3e_migration` feature branch.** ### Original PR description Work towards flutter/flutter#186906 Work towards flutter/flutter#187899 Previously, the `gen_defaults` script generated the files in different directories based on whether or not the template was an M3 or M3E template. Since we are planning on using an variant enum instead of different libraries to separate M3 and M3E implementations, the `gen_defaults` script needs to be accordingly updated. ## 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.
…ategy (flutter#12627)" This reverts commit 12e12bd.
…lutter#12627) Work towards flutter/flutter#191088 **Ports over flutter#11918 which landed on the `m3e_migration` feature branch.** ### Original PR description Work towards flutter/flutter#186906 Work towards flutter/flutter#187899 Previously, the `gen_defaults` script generated the files in different directories based on whether or not the template was an M3 or M3E template. Since we are planning on using an variant enum instead of different libraries to separate M3 and M3E implementations, the `gen_defaults` script needs to be accordingly updated. ## 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.
Work towards flutter/flutter#191088
Ports over #11918 which landed on the
m3e_migrationfeature branch.Original PR description
Work towards flutter/flutter#186906
Work towards flutter/flutter#187899
Previously, the
gen_defaultsscript generated the files in different directories based on whether or not the template was an M3 or M3E template. Since we are planning on using an variant enum instead of different libraries to separate M3 and M3E implementations, thegen_defaultsscript needs to be accordingly updated.Pre-Review Checklist
[shared_preferences]///).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-assistbot 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
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