Repository navigation
[material_ui] Migrate M3 Badge template to use new gen_defaults - #12218
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the Badge component to use the gen_defaults tool for generating default values. It introduces a new BadgeTemplateM3, a generated badge_defaults_m3.g.dart file, and updates the generator script and test suite accordingly. The reviewer suggested further improving maintainability by tokenizing the currently hardcoded padding, alignment, and textStyle properties.
0dc804e to
8bbc763
Compare
8bbc763 to
1cd49ad
Compare
|
Not ready for review because of the text style token issue. |
410290f to
9f7bf7e
Compare
fc34dc9 to
0c810cd
Compare
There was a problem hiding this comment.
Code Review
This pull request migrates the Material 3 badge defaults generation to the new template system by removing the inline _BadgeDefaultsM3 class from badge.dart and replacing it with a generated part file. It introduces the BadgeTemplateM3 template, enables its generation, and adds corresponding unit tests. The review feedback suggests simplifying BadgeTemplateM3 by removing the unused _theme field and directly initializing _colors with Theme.of(context).colorScheme.
| import '../templates/app_bar_template.dart'; | ||
| // import '../templates/badge_template.dart'; | ||
| import '../templates/badge_template.dart'; | ||
|
|
| // import '../templates/banner_template.dart'; | ||
| // import '../templates/bottom_app_bar_template.dart'; | ||
| import '../templates/bottom_sheet_template.dart'; | ||
|
|
…lutter#12218) Work towards flutter/flutter#187899 Fixes flutter/flutter#188401 - [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 `///`). - [ ] 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]. - [x] All existing and new tests are passing.
Work towards flutter/flutter#191088 **Ports over #12218 which landed on the `m3e_migration` feature branch.** ### Original PR description Work towards flutter/flutter#187899 Fixes flutter/flutter#188401 ## 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.
…ter#12733) Work towards flutter/flutter#191088 **Ports over flutter#12218 which landed on the `m3e_migration` feature branch.** ### Original PR description Work towards flutter/flutter#187899 Fixes flutter/flutter#188401 ## 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.
…ter#12733) Work towards flutter/flutter#191088 **Ports over flutter#12218 which landed on the `m3e_migration` feature branch.** ### Original PR description Work towards flutter/flutter#187899 Fixes flutter/flutter#188401 ## 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#187899
Fixes flutter/flutter#188401
Pre-Review Checklist
[shared_preferences]///).