Repository navigation
[material_ui] Migrate AppBar M3 template to use new gen_defaults script - #12122
Conversation
0d0154f to
8f8747b
Compare
There was a problem hiding this comment.
Code Review
This pull request extracts the generated Material 3 AppBar defaults into a separate file, app_bar_m3_defaults.g.dart, and introduces an AppBarTemplate class to generate this file automatically. A unit test has also been added to verify the generated defaults. Feedback suggests removing an obsolete // ignore: unused_local_variable comment in gen_defaults.dart since the verbose variable is now utilized.
elliette
left a comment
There was a problem hiding this comment.
Haven't done a thorough review, just a few quick questions.
f712d9a to
35ed6ca
Compare
35ed6ca to
999efe9
Compare
999efe9 to
e7f21ae
Compare
There was a problem hiding this comment.
Code Review
This pull request migrates the generation of Material 3 AppBar defaults to a new template-based generator. It removes the hardcoded defaults and scroll-under configurations from 'app_bar.dart' and moves them to a generated file 'app_bar_defaults_m3.g.dart'. A new 'AppBarTemplateM3' class is introduced to generate these defaults from token data, the 'gen_defaults.dart' tool is updated to invoke this template, and corresponding unit tests are added in 'gen_defaults_test.dart'. There are no review comments, and I have no feedback to provide.
…pt (#12707) Work towards flutter/flutter#191088 **Ports over #12122 which landed on the `m3e_migration` feature branch.** ### Original PR description Fixes flutter/flutter#188397 Initially gen_defaults script and its templates were used to handle JSON tokens. After we fix the token pipeline and make it possible to get M3E tokens, we use Dart constants and re-created the gen_defaults in material_ui. After decoupling, the old gen_defaults will be deprecated soon. This PR is to: create a template for M3 AppBar so we can use new script to generate M3 defaults. move the generated code to generated/ folder so all M3 and M3E generated code will be in the same location. ## 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.
…pt (flutter#12707) Work towards flutter/flutter#191088 **Ports over flutter#12122 which landed on the `m3e_migration` feature branch.** ### Original PR description Fixes flutter/flutter#188397 Initially gen_defaults script and its templates were used to handle JSON tokens. After we fix the token pipeline and make it possible to get M3E tokens, we use Dart constants and re-created the gen_defaults in material_ui. After decoupling, the old gen_defaults will be deprecated soon. This PR is to: create a template for M3 AppBar so we can use new script to generate M3 defaults. move the generated code to generated/ folder so all M3 and M3E generated code will be in the same location. ## 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.
…pt (flutter#12707) Work towards flutter/flutter#191088 **Ports over flutter#12122 which landed on the `m3e_migration` feature branch.** ### Original PR description Fixes flutter/flutter#188397 Initially gen_defaults script and its templates were used to handle JSON tokens. After we fix the token pipeline and make it possible to get M3E tokens, we use Dart constants and re-created the gen_defaults in material_ui. After decoupling, the old gen_defaults will be deprecated soon. This PR is to: create a template for M3 AppBar so we can use new script to generate M3 defaults. move the generated code to generated/ folder so all M3 and M3E generated code will be in the same location. ## 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.
Will land #12209 first.Fixes flutter/flutter#188397
Initially gen_defaults script and its templates were used to handle JSON tokens. After we fix the token pipeline and make it possible to get M3E tokens, we use Dart constants and re-created the gen_defaults in material_ui. After decoupling, the old gen_defaults will be deprecated soon.
This PR is to:
AppBarso we can use new script to generate M3 defaults.generated/folder so all M3 and M3E generated code will be in the same location.Pre-Review Checklist
[shared_preferences]///).