Repository navigation
[material_ui] Migrate M3 Motion template to use new gen_defaults - #13058
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the Material 3 motion defaults to a template-based generator (MotionTemplateM3), moving the hardcoded tokens from motion.dart into a generated file and introducing a helper Cubic struct. The generation tool and tests are updated to support this template. The review feedback suggests improving the formatting of the generated code templates in motion_template.dart by using .trimRight() to place the closing braces of the generated classes on separate lines.
| ${_durationTokenString('extralong1', TokenMotionStandard.durationExtraLong1)} | ||
| ${_durationTokenString('extralong2', TokenMotionStandard.durationExtraLong2)} | ||
| ${_durationTokenString('extralong3', TokenMotionStandard.durationExtraLong3)} | ||
| ${_durationTokenString('extralong4', TokenMotionStandard.durationExtraLong4)}} |
There was a problem hiding this comment.
The closing brace } is placed directly after the string interpolation as }}, which can be hard to read and error-prone during future edits. Using .trimRight() on the last token string allows placing the closing brace on its own line without introducing an extra blank line.
| ${_durationTokenString('extralong4', TokenMotionStandard.durationExtraLong4)}} | |
| ${_durationTokenString('extralong4', TokenMotionStandard.durationExtraLong4).trimRight()} | |
| } |
| ${_easingCurveTokenString('standardDecelerate', TokenMotionStandard.easingStandardDecelerate)} | ||
| ${_easingCurveTokenString('legacyDecelerate', TokenMotionStandard.easingLegacyDecelerate)} | ||
| ${_easingCurveTokenString('legacyAccelerate', TokenMotionStandard.easingLegacyAccelerate)} | ||
| ${_easingCurveTokenString('legacy', TokenMotionStandard.easingLegacy)}} |
There was a problem hiding this comment.
The closing brace } is placed directly after the string interpolation as }}, which can be hard to read and error-prone during future edits. Using .trimRight() on the last token string allows placing the closing brace on its own line without introducing an extra blank line.
${_easingCurveTokenString('legacy', TokenMotionStandard.easingLegacy).trimRight()}
}…migration # Conflicts: # packages/material_ui/tool/gen_defaults/data/cubic_struct.dart # packages/material_ui/tool/gen_defaults/data/motion_expressive.dart
…migration # Conflicts: # packages/material_ui/tool/gen_defaults/bin/gen_defaults.dart # packages/material_ui/tool/gen_defaults/test/gen_defaults_test.dart
…er#193840) flutter/packages@5620e65...951f2f7 2026-10-05 [email protected] [material_ui] Add scrollPadding property to DropdownMenuFormField (flutter/packages#12735) 2026-10-02 [email protected] [material_ui] Migrate M3 Motion template to use new gen_defaults (flutter/packages#13058) 2026-10-02 [email protected] [cupertino_ui] Forward showDragHandle from showCupertinoSheet to CupertinoSheetRoute (flutter/packages#13011) 2026-10-02 [email protected] [cupertino_ui] Fix CupertinoMagnifier focal point with custom size (flutter/packages#13029) 2026-10-02 [email protected] [ci] Add material_ui and cupertino_ui to customer testing (flutter/packages#13114) 2026-10-02 [email protected] [material_ui] Add Material 3 Expressive migration skill (flutter/packages#12818) 2026-10-02 [email protected] [video_player] Ignore late position updates after disposal (flutter/packages#12971) 2026-10-02 [email protected] [material_ui] Remove unconditional dart:io import from about.dart (flutter/packages#12774) 2026-10-02 [email protected] [material_ui] Fix DropdownButtonFormField underline alignment at bottom (flutter/packages#12606) 2026-10-02 [email protected] Roll Flutter from e89fd0a to d03768e (23 revisions) (flutter/packages#13111) 2026-10-02 [email protected] [material_ui] Migrate `Switch` API doc snippets to {@example} (batch 8) (flutter/packages#13052) 2026-10-02 [email protected] [url_launcher] Fix supportsCloseForLaunchMode to query close support (flutter/packages#12926) 2026-10-02 [email protected] Redistribute iOS/macOS Suggested Reviewers (flutter/packages#13076) 2026-10-02 [email protected] [image_picker] Subsample large images when resizing on Android (flutter/packages#13038) 2026-10-02 [email protected] [cupertino_ui] Remove redundant null arguments in Completer.complete (flutter/packages#13008) 2026-10-02 [email protected] [repo] Update AGENTS.md with dependency allowance and versioning guidance (flutter/packages#12579) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Work toward flutter/flutter#187899.
Fixes flutter/flutter#188422.
This PR migrates the M3 Motion defaults template to use the new gen_defaults in material_ui.
The generated defaults remain unchanged.
Pre-Review Checklist
[shared_preferences]///).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-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