[material_ui] Migrate AppBar M3 template to use new gen_defaults script#12122
[material_ui] Migrate AppBar M3 template to use new gen_defaults script#12122QuncCccccc wants to merge 4 commits into
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.
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]///).