Skip to content

[material_ui] Add all M3 templates and generated code to temporarily_excluded/ before migration - #12206

Merged
elliette merged 4 commits into
flutter:m3e_migrationfrom
elliette:gen-defaults-baseline
Jul 15, 2026
Merged

elliette merged 4 commits into
flutter:m3e_migrationfrom
elliette:gen-defaults-baseline

Conversation

@elliette

@elliette elliette commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Work towards flutter/flutter#187899

Moves all M3 templates and their generated code to gen_defaults/temporarily_excluded before we begin migrating.

This way when we migrate each component, we can first move the template and its respective generated code into the new directories, edit the template, and re-generate the code. This will make it easier to review changes to the templates and validate the generated output.

Pre-Review Checklist

  • Test exemption: Copying code from flutter/flutter

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

Footnotes

  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. ↩ ↩2

@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels Jul 15, 2026
@elliette elliette changed the title [DRAFT] Add all M3 templates and generated code to temporarily_disabled/ before migration Add all M3 templates and generated code to temporarily_excluded/ before migration Jul 15, 2026
@elliette elliette changed the title Add all M3 templates and generated code to temporarily_excluded/ before migration [material_ui] Add all M3 templates and generated code to temporarily_excluded/ before migration Jul 15, 2026
@elliette
elliette marked this pull request as ready for review July 15, 2026 20:28
@elliette
elliette requested a review from QuncCccccc July 15, 2026 20:28
@elliette elliette added the CICD Run CI/CD label Jul 15, 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 introduces generated Material 3 defaults and templates under a temporarily excluded directory, updating the analysis options accordingly. Feedback on the changes highlights a typo in the generated list tile class name, the incorrect use of an outline width token for a checkbox corner radius, and several instances of deprecated MaterialStatePropertyAll usage in the button and switch templates that should be updated to WidgetStatePropertyAll.

Comment on lines +5 to +6
class _LisTileDefaultsM3 extends ListTileThemeData {
_LisTileDefaultsM3(this.context)

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.

medium

There is a typo in the generated class name _LisTileDefaultsM3 (missing 't' in ListTile). This is likely caused by the blockName configuration passed to ListTileTemplate being set to 'LisTile' instead of 'ListTile'. Please update the generator configuration to use 'ListTile' so that the generated class name is correct.

Comment on lines +138 to +141

@override
OutlinedBorder get shape => const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(${getToken('md.comp.checkbox.unselected.outline.width')})),

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.

medium

The template uses md.comp.checkbox.unselected.outline.width to define the corner radius of the checkbox shape. While both the outline width and the corner radius happen to be 2.0 in the current specification, they are semantically unrelated. Using the outline width token for the corner radius is a bug that could lead to incorrect rendering if the outline width is updated in the future. Consider using the correct shape/corner-radius token or a hardcoded value of 2.0 if a specific token is not available.

Comment on lines +59 to +65
String _elevationColor(String token) {
if (tokenAvailable(token)) {
return 'MaterialStatePropertyAll<Color>(${color(token)})';
} else {
return 'const MaterialStatePropertyAll<Color>(Colors.transparent)';
}
}

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.

medium

The template uses the deprecated MaterialStatePropertyAll class. Since Flutter 3.22, MaterialStateProperty and its associated classes have been deprecated in favor of WidgetStateProperty and WidgetStatePropertyAll. Consider updating this to use WidgetStatePropertyAll to align with modern Flutter practices.

Suggested change
String _elevationColor(String token) {
if (tokenAvailable(token)) {
return 'MaterialStatePropertyAll<Color>(${color(token)})';
} else {
return 'const MaterialStatePropertyAll<Color>(Colors.transparent)';
}
}
String _elevationColor(String token) {
if (tokenAvailable(token)) {
return 'WidgetStatePropertyAll<Color>(${color(token)})';
} else {
return 'const WidgetStatePropertyAll<Color>(Colors.transparent)';
}
}

Comment on lines +80 to +82
@override
WidgetStateProperty<TextStyle?> get textStyle =>
MaterialStatePropertyAll<TextStyle?>(${textStyle("$tokenGroup.label-text")});

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.

medium

The template uses the deprecated MaterialStatePropertyAll class. Consider updating this to use WidgetStatePropertyAll to align with modern Flutter practices.

Suggested change
@override
WidgetStateProperty<TextStyle?> get textStyle =>
MaterialStatePropertyAll<TextStyle?>(${textStyle("$tokenGroup.label-text")});
@override
WidgetStateProperty<TextStyle?> get textStyle =>
WidgetStatePropertyAll<TextStyle?>(${textStyle("$tokenGroup.label-text")});

Comment on lines +127 to +129
}
return null;
});

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.

medium

The template uses the deprecated MaterialStatePropertyAll class. Consider updating this to use WidgetStatePropertyAll to align with modern Flutter practices.

Suggested change
}
return null;
});
@override
WidgetStatePropertyAll<double> get trackOutlineWidth =>
const WidgetStatePropertyAll<double>(${getToken('md.comp.switch.track.outline.width')});

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

LGTM! Thanks!

@elliette
elliette merged commit 60276b7 into flutter:m3e_migration Jul 15, 2026
4 of 6 checks passed
auto-submit Bot pushed a commit that referenced this pull request Aug 28, 2026
…_excluded/` before migration (#12661)

Work towards flutter/flutter#191088

**Ports over #12206 which landed on the `m3e_migration` feature branch.**

### Original PR description

Work towards flutter/flutter#187899

Moves all M3 templates and their generated code to gen_defaults/temporarily_excluded before we begin migrating.

This way when we migrate each component, we can first move the template and its respective generated code into the new directories, edit the template, and re-generate the code. This will make it easier to review changes to the templates and validate the generated output.

## 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
…_excluded/` before migration (flutter#12661)

Work towards flutter/flutter#191088

**Ports over flutter#12206 which landed on the `m3e_migration` feature branch.**

### Original PR description

Work towards flutter/flutter#187899

Moves all M3 templates and their generated code to gen_defaults/temporarily_excluded before we begin migrating.

This way when we migrate each component, we can first move the template and its respective generated code into the new directories, edit the template, and re-generate the code. This will make it easier to review changes to the templates and validate the generated output.

## 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
…_excluded/` before migration (flutter#12661)

Work towards flutter/flutter#191088

**Ports over flutter#12206 which landed on the `m3e_migration` feature branch.**

### Original PR description

Work towards flutter/flutter#187899

Moves all M3 templates and their generated code to gen_defaults/temporarily_excluded before we begin migrating.

This way when we migrate each component, we can first move the template and its respective generated code into the new directories, edit the template, and re-generate the code. This will make it easier to review changes to the templates and validate the generated output.

## 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