Repository navigation
[material_ui] Add all M3 templates and generated code to temporarily_excluded/ before migration - #12206
Conversation
temporarily_disabled/ before migrationtemporarily_excluded/ before migration
temporarily_excluded/ before migrationtemporarily_excluded/ before migration
There was a problem hiding this comment.
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.
| class _LisTileDefaultsM3 extends ListTileThemeData { | ||
| _LisTileDefaultsM3(this.context) |
There was a problem hiding this comment.
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.
|
|
||
| @override | ||
| OutlinedBorder get shape => const RoundedRectangleBorder( | ||
| borderRadius: BorderRadius.all(Radius.circular(${getToken('md.comp.checkbox.unselected.outline.width')})), |
There was a problem hiding this comment.
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.
| String _elevationColor(String token) { | ||
| if (tokenAvailable(token)) { | ||
| return 'MaterialStatePropertyAll<Color>(${color(token)})'; | ||
| } else { | ||
| return 'const MaterialStatePropertyAll<Color>(Colors.transparent)'; | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
| 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)'; | |
| } | |
| } |
| @override | ||
| WidgetStateProperty<TextStyle?> get textStyle => | ||
| MaterialStatePropertyAll<TextStyle?>(${textStyle("$tokenGroup.label-text")}); |
There was a problem hiding this comment.
The template uses the deprecated MaterialStatePropertyAll class. Consider updating this to use WidgetStatePropertyAll to align with modern Flutter practices.
| @override | |
| WidgetStateProperty<TextStyle?> get textStyle => | |
| MaterialStatePropertyAll<TextStyle?>(${textStyle("$tokenGroup.label-text")}); | |
| @override | |
| WidgetStateProperty<TextStyle?> get textStyle => | |
| WidgetStatePropertyAll<TextStyle?>(${textStyle("$tokenGroup.label-text")}); |
| } | ||
| return null; | ||
| }); |
There was a problem hiding this comment.
The template uses the deprecated MaterialStatePropertyAll class. Consider updating this to use WidgetStatePropertyAll to align with modern Flutter practices.
| } | |
| return null; | |
| }); | |
| @override | |
| WidgetStatePropertyAll<double> get trackOutlineWidth => | |
| const WidgetStatePropertyAll<double>(${getToken('md.comp.switch.track.outline.width')}); |
…_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.
…_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.
…_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.
Work towards flutter/flutter#187899
Moves all M3 templates and their generated code to
gen_defaults/temporarily_excludedbefore 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
[shared_preferences]///).flutter/flutterIf 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-assistbot 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
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