[material_ui, cupertino_ui] Migrate @macros that are defined in Material and used in Cupertino#12197
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates several documentation templates from material_ui to cupertino_ui, replacing the inline templates in material_ui with macros that reference the newly defined templates in cupertino_ui. The review feedback highlights a potential issue with broken dartdoc links in cupertino_ui due to referencing Material-specific widgets in square brackets, as well as a few minor grammatical errors in the newly migrated templates in packages/cupertino_ui/lib/src/radio.dart.
@macros used in Cupertino while defined in Material@macros that are defined in Material and used in Cupertino
Piinks
left a comment
There was a problem hiding this comment.
LGTM, we can fix the glow one with a library prefix. Some examples to look up in flutter/flutter: [ui.Image], [ui.Rect]
| /// [ScrollBehavior]s describe how [Scrollable] widgets behave. Providing | ||
| /// a [ScrollBehavior] can set the default [ScrollPhysics] across | ||
| /// an application, and manage [Scrollable] decorations like [Scrollbar]s and | ||
| /// [GlowingOverscrollIndicator]s. |
There was a problem hiding this comment.
In mine I had removed the GlowingOversrollIndicator since I don't think it will work from cupertino_ui?
There was a problem hiding this comment.
We can fix it in another PR, which probably requires more domain specific knowledge that I have. This was a template, so if the doc is wrong it's not caused by this PR, but a long existing problem in our doc (which can happen).
There was a problem hiding this comment.
We can fix it in another PR
SGTM
This was a template, so if the doc is wrong it's not caused by this PR, but a long existing problem in our doc (which can happen).
I don't know that it was wrong, when they were both in the SDK it resolved correctly. Actually, I just checked, and it looks like GlowingOverscrollIndicator is defined in widgets 🙃
…r#189509) flutter/packages@ad2eab1...9f95026 2026-07-15 katelovett@google.com [google_fonts] Extract the config class to its own file (flutter/packages#12202) 2026-07-14 jessiewong401@gmail.com Update All Flutter Android Example Apps to 3.47 Template Versions (flutter/packages#12195) 2026-07-14 engine-flutter-autoroll@skia.org Roll Flutter from cf9e8af to 846664b (24 revisions) (flutter/packages#12200) 2026-07-14 oss@simonbinder.eu [go_router_builder] Support analyzer 13 (flutter/packages#12189) 2026-07-14 stuartmorgan@google.com [shared_preferences] Convert legacy tests to Kotlin (flutter/packages#12193) 2026-07-13 dkwingsmt@users.noreply.github.com [material_ui, cupertino_ui] Migrate `@macro`s that are defined in Material and used in Cupertino (flutter/packages#12197) 2026-07-13 dkwingsmt@users.noreply.github.com [material_ui, cupertino_ui] Add `#region` to example files to remove license headers (flutter/packages#12170) 2026-07-13 73310711+shrabanti722@users.noreply.github.com [video_player] Implement screen auto-lock control for video playback (flutter/packages#11225) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com 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
The
dartdocrequires that@macrowill only search@templatefromdependenciespackages, notdev_dependencies. Before this PR, both Cupertino and Material have used macros defined in the other package, and this does not completely work becausecupertino_uionly listsmaterial_uias a dev dependency. On the other hand,material_uilistscupertino_uias a dependency and we plan to keep this way for a long time due to support for adaptive widgets.This PR hence solves this macro problem by migrating all malfunctioning macros to be defined in
cupertino_uiinstead.The changes were made in a script written by Gemini.
Known issue
Referencing breadcrumbs ("square brackets") from
material_uiincupertino_uidoes not work for now. The result is non-blocking for now, where all widget names (such as[Button]) do not have hyperlinks but are simply backticks. This is likely because of dart-lang/sdk#62812. Simply put,dartdoconly checks in symbols frommaterial_uiifmaterial_uiisimported somewhere at least once, which meansmaterial_uimust be a dependency (not a dev dependency) ofcupertino_ui. If dart-lang/sdk#62812 can be fixed, adocImportwould makedartdocchecks in symbols.Also, this problem can be worsened as we develop next generation Cupertino widgets, since
cupertino_uiis planning to remove the prefixes and therefore have widget name conflicts withmaterial_ui, anddocImportcurrently does not supportas. For example, if a widget incupertino_uirefers to a[Dialog], which dialog does it refer to?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