Skip to content

[material_ui, cupertino_ui] Add #region to example files to remove license headers#12170

Open
dkwingsmt wants to merge 6 commits into
flutter:mainfrom
dkwingsmt:example-region
Open

[material_ui, cupertino_ui] Add #region to example files to remove license headers#12170
dkwingsmt wants to merge 6 commits into
flutter:mainfrom
dkwingsmt:example-region

Conversation

@dkwingsmt

@dkwingsmt dkwingsmt commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This PR adds #region to example files to remove the license headers.

Before:

image

After:

image

Verification

I have audited all example files to ensure every file belongs to one of the following types:

  • Referenced in material_ui or cupertino_ui: These have been updated in this PR to include the #region tags.
  • Not referenced and not for a Material/Cupertino widget: These files have been removed in PR [material_ui] Remove unused example files  #12179.
  • Not referenced but for a Material/Cupertino widget: The following two files remain, and we should consider adding them to the respective API documentation in the future:
material_ui/example/lib/selection_area/selection_area.1.dart
material_ui/example/lib/selection_area/selection_area.2.dart

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 9, 2026
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: cupertino_ui p: material_ui labels Jul 9, 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 introduces // #region body and // #endregion body tags to example files in both cupertino_ui and material_ui packages, and updates example references in cupertino_ui source files to target the #body region. Feedback indicates that several material_ui example files are missing the opening // #region body tag, and the corresponding material_ui library source files have not been updated to append #body to their example references.

Comment thread packages/material_ui/example/lib/about/about_list_tile.0.dart
Comment thread packages/material_ui/example/lib/platform_menu_bar/platform_menu_bar.0.dart Outdated
@dkwingsmt

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing. Some of the files need extra treatment before this PR can be merged. For example, some files correspond to widgets defined in flutter/widgets, so these files should be moved instead of changed here. I'll review them before requesting for another review.

@dkwingsmt dkwingsmt marked this pull request as draft July 10, 2026 17:53
@Piinks

Piinks commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Some of the files need extra treatment before this PR can be merged. For example, some files correspond to widgets defined in flutter/widgets, so these files should be moved instead of changed here.

What do you mean? It is ok to have an example copied over from widgets/ for use in the API docs here. We just moved some of those samples over last week.

@dkwingsmt

dkwingsmt commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@Piinks Most files mentioned above are not referenced in material_ui at all. They're testing widgets defined in flutter/widgets and are referred to only by widgets in flutter/widgets. They should totally reside in flutter/widgets.

@github-actions github-actions Bot removed the CICD Run CI/CD label Jul 13, 2026
@dkwingsmt dkwingsmt marked this pull request as ready for review July 13, 2026 05:18
@dkwingsmt dkwingsmt added the CICD Run CI/CD label Jul 13, 2026
@dkwingsmt

Copy link
Copy Markdown
Contributor Author

This PR is ready for another round of review.

I have audited all example files to ensure every file belongs to one of the following types:

  • Referenced in material_ui or cupertino_ui: These have been updated in this PR to include the #region tags.
  • Not referenced and not for a Material/Cupertino widget: These files have been removed in PR [material_ui] Remove unused example files  #12179.
  • Not referenced but for a Material/Cupertino widget: The following two files remain, and we should consider adding them to the respective API documentation in the future:
material_ui/example/lib/selection_area/selection_area.1.dart
material_ui/example/lib/selection_area/selection_area.2.dart

@dkwingsmt

Copy link
Copy Markdown
Contributor Author

/gemini review

@dkwingsmt dkwingsmt requested a review from Piinks July 13, 2026 05:19

@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 numerous example files across the cupertino_ui and material_ui packages to wrap code samples with // #region body and // #endregion body comments, while updating corresponding documentation references to target the #body suffix. However, several files in the material_ui package add the closing // #endregion body tag without the matching opening // #region body tag at the top of the file.

);
}
}
// #endregion body

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.

high

The closing tag // #endregion body is added here, but the matching opening tag // #region body is missing at the top of the file. Please add // #region body right after the license header at the top of the file so that the region is correctly defined.

);
}
}
// #endregion body

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.

high

The closing tag // #endregion body is added here, but the matching opening tag // #region body is missing at the top of the file. Please add // #region body right after the license header at the top of the file so that the region is correctly defined.

r'(?<topLevelDomain>[a-zA-Z0-9]+)',
).hasMatch(text);
}
// #endregion body

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.

high

The closing tag // #endregion body is added here, but the matching opening tag // #region body is missing at the top of the file. Please add // #region body right after the license header at the top of the file so that the region is correctly defined.

);
}
}
// #endregion body

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.

high

The closing tag // #endregion body is added here, but the matching opening tag // #region body is missing at the top of the file. Please add // #region body right after the license header at the top of the file so that the region is correctly defined.

@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 example files across the cupertino_ui and material_ui packages to define code regions using // #region body and // #endregion body tags, while updating the source file documentation references to target these specific regions. Feedback indicates that several example files are missing the corresponding // #region body tag at the top of the file, despite having the // #endregion body tag added at the end.

);
}
}
// #endregion body

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.

high

This file has // #endregion body added at the end, but is missing the corresponding // #region body at the top of the file. Please add // #region body at the top of the file (typically right after the imports) to correctly define the region.

);
}
}
// #endregion body

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.

high

This file has // #endregion body added at the end, but is missing the corresponding // #region body at the top of the file. Please add // #region body at the top of the file (typically right after the imports) to correctly define the region.

r'(?<topLevelDomain>[a-zA-Z0-9]+)',
).hasMatch(text);
}
// #endregion body

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.

high

This file has // #endregion body added at the end, but is missing the corresponding // #region body at the top of the file. Please add // #region body at the top of the file (typically right after the imports) to correctly define the region.

);
}
}
// #endregion body

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.

high

This file has // #endregion body added at the end, but is missing the corresponding // #region body at the top of the file. Please add // #region body at the top of the file (typically right after the imports) to correctly define the region.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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