Skip to content

[material_ui] Migrate M3 Badge template to use new gen_defaults - #12218

Merged
QuncCccccc merged 3 commits into
flutter:m3e_migrationfrom
QuncCccccc:badge_m3_defaults_migration
Aug 12, 2026
Merged

QuncCccccc merged 3 commits into
flutter:m3e_migrationfrom
QuncCccccc:badge_m3_defaults_migration

Conversation

@QuncCccccc

@QuncCccccc QuncCccccc commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Work towards flutter/flutter#187899
Fixes flutter/flutter#188401

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • 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].
  • 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].
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 16, 2026
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels Jul 16, 2026

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

@QuncCccccc
QuncCccccc force-pushed the badge_m3_defaults_migration branch 3 times, most recently from 0dc804e to 8bbc763 Compare July 16, 2026 21:46
@QuncCccccc
QuncCccccc requested a review from elliette July 16, 2026 21:49
@QuncCccccc
QuncCccccc force-pushed the badge_m3_defaults_migration branch from 8bbc763 to 1cd49ad Compare July 16, 2026 23:40
@QuncCccccc
QuncCccccc removed the request for review from elliette July 16, 2026 23:48
@QuncCccccc
QuncCccccc marked this pull request as draft July 16, 2026 23:48
@QuncCccccc

Copy link
Copy Markdown
Contributor Author

Not ready for review because of the text style token issue.

@QuncCccccc
QuncCccccc force-pushed the badge_m3_defaults_migration branch 4 times, most recently from 410290f to 9f7bf7e Compare August 6, 2026 22:04
@QuncCccccc
QuncCccccc force-pushed the badge_m3_defaults_migration branch from fc34dc9 to 0c810cd Compare August 7, 2026 22:18
@QuncCccccc
QuncCccccc marked this pull request as ready for review August 7, 2026 23:03

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

@QuncCccccc
QuncCccccc requested a review from elliette August 8, 2026 00:11
import '../templates/app_bar_template.dart';
// import '../templates/badge_template.dart';
import '../templates/badge_template.dart';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove new line here?

// import '../templates/banner_template.dart';
// import '../templates/bottom_app_bar_template.dart';
import '../templates/bottom_sheet_template.dart';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And here?

@QuncCccccc
QuncCccccc merged commit b189c7e into flutter:m3e_migration Aug 12, 2026
3 of 6 checks passed
elliette pushed a commit to elliette/packages that referenced this pull request Sep 3, 2026
…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.
auto-submit Bot pushed a commit that referenced this pull request Sep 4, 2026
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.
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…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.
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD p: material_ui triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants