Skip to content

[material_ui, cupertino_ui] Rename macro names to package names#12198

Merged
auto-submit[bot] merged 1 commit into
flutter:mainfrom
dkwingsmt:rename-macro
Jul 15, 2026
Merged

[material_ui, cupertino_ui] Rename macro names to package names#12198
auto-submit[bot] merged 1 commit into
flutter:mainfrom
dkwingsmt:rename-macro

Conversation

@dkwingsmt

@dkwingsmt dkwingsmt commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This PR rename macro names from flutter.material.* to material_ui.*, and flutter.cupertino.* to cupertino_ui.*.

These changes are not only aesthetic, but also functionally necessary, because the current macro names are also present in the Flutter framework. Since the dartdoc also read the framework, it will treat all macros/templates of the same name as duplicate entries, and will always display the macro content from the Flutter framework.

For example, the following screenshot shows the page of cupertino_ui.CupertinoCheckbox.fillColor as of 745da2e .
image

Despite that we have long migrated it away from @tool snippet,

/// <callout-box>
///
// TODO(framework): Add unit tests to this code snippet.
// https://github.com/flutter/flutter/issues/188530
///
/// This example resolves the [fillColor] based on the current [WidgetState]
/// of the [CupertinoCheckbox], providing a different [Color] when it is
/// [WidgetState.disabled].
///
/// ```dart
/// CupertinoCheckbox(
/// value: true,
/// onChanged: (_){},
/// fillColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.disabled)) {
/// return Colors.orange.withValues(alpha: .32);
/// }
/// return Colors.orange;
/// })
/// )

they still show @tool snippet because dartdoc replaces the cupertino_ui doc with the content from flutter/cupertino (link).

This issue is fixed after this PR.

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 14, 2026
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: cupertino_ui p: material_ui labels Jul 14, 2026
@dkwingsmt
dkwingsmt requested a review from Piinks July 14, 2026 05:10

@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 updates documentation template and macro references across the cupertino_ui and material_ui packages, replacing the flutter.cupertino and flutter.material prefixes with cupertino_ui and material_ui respectively. The review feedback identifies a few incorrect macro and template references, including an incorrect macro reference for SimpleDialog.alignment and a duplicate template name for CupertinoTextSelectionToolbarButton.buttonItem.

Comment thread packages/material_ui/lib/src/dialog.dart
Comment thread packages/cupertino_ui/lib/src/text_selection_toolbar_button.dart

@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 thank you!

final Iterable<String>? autofillHints;

/// {@template flutter.cupertino.Material.clipBehavior}
/// {@template cupertino_ui.Material.clipBehavior}

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.

This one might be wonky, not super urgent, but Material is not defined in cupertino

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.

Oh yeah. This was probably due to the last rename. I think it doesn't need to belong to Material., but just the general clipBehavior.

@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 15, 2026
@auto-submit
auto-submit Bot merged commit 519727c into flutter:main Jul 15, 2026
89 checks passed
/// {@macro flutter.widgets.editableText.keyboardType}
final TextInputType keyboardType;

/// {@template flutter.widgets.TextField.textInputAction}

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.

Would this template also conflict with framework/material?

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.

You're totally right! I should definitely change them. Actually I should change all template names. I'll prepare a PR soon.

/// for the given use case. See the subclass documentation for details.
final Color? backgroundColor;

/// {@template flutter.progress_indicator.ProgressIndicator.color}

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.

Would instances of flutter.progress_indicator.ProgressIndicator cause conflicts with flutter/material? There are a few below this one.

auto-submit Bot pushed a commit that referenced this pull request Jul 16, 2026
This PR follows up the comment under #12198, and renames all remaining `@template`s so that no templates conflict with the framework.

Note: The templates in `generated_cupertino_localizations.dart` and `generated_material_localizations.dart` have been left as-is for now, as these files are auto-generated. A separate migration of the generation script will be required to address those specific instances.

## 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.
auto-submit Bot pushed a commit that referenced this pull request Jul 16, 2026
This PR renames macros used by l10n.

For why the rename is needed, see #12198.

## 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.
pull Bot pushed a commit to safarmer/flutter that referenced this pull request Jul 17, 2026
…er#189659)

flutter/packages@9f95026...4fdc766

2026-07-17 [email protected] [pigeon] allow empty class
(flutter/packages#12181)
2026-07-16 [email protected] [material_ui,
cupertino_ui] Rename l10n macros (flutter/packages#12211)
2026-07-16 [email protected] [ci] Remove manual SwiftPM enabling
step (flutter/packages#12204)
2026-07-16 [email protected] [google_maps_flutter] Fix XCUITest on
stable (flutter/packages#12214)
2026-07-16 [email protected] [google_maps_flutter] Convert
XCUITests to Swift (flutter/packages#12208)
2026-07-16 [email protected] [material_ui] Rename the
remaining templates (flutter/packages#12210)
2026-07-15 [email protected] [material_ui,
cupertino_ui] Rename macro names to package names
(flutter/packages#12198)
2026-07-15 [email protected] [material_ui] Fix upstream localization
test (flutter/packages#12207)
2026-07-15 [email protected] [material_ui, cupertino_ui]
Localizations (flutter/packages#12119)
2026-07-15 [email protected] fix(ci): harden some workflows in packages
(flutter/packages#12178)
2026-07-15 [email protected] Roll Flutter from
846664b to fc1ad95 (18 revisions) (flutter/packages#12203)

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

3 participants