Skip to content

[material_ui, cupertino_ui] Migrate @macros that are defined in Material and used in Cupertino#12197

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
dkwingsmt:migrate-mc-macro
Jul 13, 2026
Merged

[material_ui, cupertino_ui] Migrate @macros that are defined in Material and used in Cupertino#12197
auto-submit[bot] merged 2 commits into
flutter:mainfrom
dkwingsmt:migrate-mc-macro

Conversation

@dkwingsmt

@dkwingsmt dkwingsmt commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The dartdoc requires that @macro will only search @template from dependencies packages, not dev_dependencies. Before this PR, both Cupertino and Material have used macros defined in the other package, and this does not completely work because cupertino_ui only lists material_ui as a dev dependency. On the other hand, material_ui lists cupertino_ui as 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_ui instead.

The changes were made in a script written by Gemini.

Known issue

Referencing breadcrumbs ("square brackets") from material_ui in cupertino_ui does 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, dartdoc only checks in symbols from material_ui if material_ui is imported somewhere at least once, which means material_ui must be a dependency (not a dev dependency) of cupertino_ui. If dart-lang/sdk#62812 can be fixed, a docImport would make dartdoc checks in symbols.

Also, this problem can be worsened as we develop next generation Cupertino widgets, since cupertino_ui is planning to remove the prefixes and therefore have widget name conflicts with material_ui, and docImport currently does not support as. For example, if a widget in cupertino_ui refers to a [Dialog], which dialog does it refer to?

Pre-Review Checklist

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

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 13, 2026
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: cupertino_ui p: material_ui labels Jul 13, 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 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.

Comment thread packages/cupertino_ui/lib/src/dialog.dart
Comment thread packages/cupertino_ui/lib/src/radio.dart
Comment thread packages/cupertino_ui/lib/src/radio.dart
@dkwingsmt dkwingsmt changed the title [material_ui, cupertino_ui] Migrate @macros used in Cupertino while defined in Material [material_ui, cupertino_ui] Migrate @macros that are defined in Material and used in Cupertino Jul 13, 2026
@dkwingsmt
dkwingsmt requested a review from Piinks July 13, 2026 22:59
@github-actions github-actions Bot removed the CICD Run CI/CD label Jul 13, 2026

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

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.

In mine I had removed the GlowingOversrollIndicator since I don't think it will work from cupertino_ui?

@dkwingsmt dkwingsmt Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

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.

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 🙃

@dkwingsmt dkwingsmt added autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD labels Jul 13, 2026
@auto-submit
auto-submit Bot merged commit 745da2e into flutter:main Jul 13, 2026
90 checks passed
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Jul 15, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: cupertino_ui 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