Skip to content

[material_ui] Migrate api sample code to @example dartdoc directive#12078

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
dkwingsmt:migrate_material
Jul 2, 2026
Merged

[material_ui] Migrate api sample code to @example dartdoc directive#12078
auto-submit[bot] merged 2 commits into
flutter:mainfrom
dkwingsmt:migrate_material

Conversation

@dkwingsmt

@dkwingsmt dkwingsmt commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Migrates @tool directives to @example in material_ui
Towards flutter/flutter#172936 and flutter/flutter#172937

Prerequisite:

Related:

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 Jun 30, 2026
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels Jun 30, 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 replaces {@tool dartpad} and {@tool snippet} documentation blocks across numerous Material UI source files with TODO comments referencing tracking issues for future @dartpad directive and blue example container support. Additionally, a comment was removed from the example's analysis_options.yaml file. There are no review comments, and I have no feedback to provide.

@dkwingsmt dkwingsmt requested review from Piinks and justinmc June 30, 2026 22:29
@dkwingsmt dkwingsmt marked this pull request as draft June 30, 2026 22:31
@dkwingsmt dkwingsmt marked this pull request as ready for review June 30, 2026 22:35
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 30, 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 documentation examples and Dartpad tool blocks across various Material UI files to use the {@example} directive or adds TODO comments to replace them once supported. The reviewer identified two instances in app_bar.dart and material_state.dart where references to example files were missed during the migration and should be updated to use the {@example} directive.

///
/// Here is an example of [SliverAppBar] when using [stretch] and [onStretchTrigger].
///
/// ** See code in examples/api/lib/material/app_bar/sliver_app_bar.4.dart **

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.

medium

This reference to sliver_app_bar.4.dart was missed during the migration to the {@example} directive. It should be updated to use the {@example} directive with the correct path.

/// {@example /example/lib/app_bar/sliver_app_bar.4.dart}

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.

++
Maybe a quick search of "See code in" and "@tool" will catch any others?

/// implementation of [MaterialStateOutlinedBorder], that resolves to
/// [RoundedRectangleBorder] when its widget is selected.
///
/// ** See code in examples/api/lib/widgets/widget_state/widget_state_outlined_border.0.dart **

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.

medium

This reference to widget_state_outlined_border.0.dart was missed during the migration to the {@example} directive. It should be updated to use the {@example} directive with the correct path.

/// {@example /example/lib/widgets/widget_state/widget_state_outlined_border.0.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.

The analyzer failure is just the @example directive not being recognized, so it just needs that override from the sample PR. 👍

@justinmc justinmc added the CICD Run CI/CD label Jul 1, 2026

@justinmc justinmc 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 👍

@fluttergithubbot

Copy link
Copy Markdown
Contributor

An existing Git SHA, 9e39f7a9c394781774e62878daeaad39030905f2, was detected, and no actions were taken.

To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with --force) that already was pushed before, push a blank commit (git commit --allow-empty -m "Trigger Build") or rebase to continue.

@Piinks

Piinks commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

#12063 landed with the @example mitigation for the analyzer. Rebasing should pick it up here and this should be good to go!

@dkwingsmt dkwingsmt added the CICD Run CI/CD label Jul 1, 2026
auto-submit Bot pushed a commit that referenced this pull request Jul 2, 2026
This adds missing samples referenced in the material_ui API docs.
Some of these were misplaced in the widgets/ API directory in flutter/flutter, I will push up a PR to reflect the move there as well so we do not lose track of it.

Towards flutter/flutter#172936 and flutter/flutter#172937

Related:
* #12078, which migrates samples in `material_ui` and depends on this PR.
* #12086, which moves similar missing sample files for `cupertino_ui`

## 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.
@github-actions github-actions Bot removed the CICD Run CI/CD label Jul 2, 2026
@dkwingsmt dkwingsmt added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Jul 2, 2026
@auto-submit auto-submit Bot merged commit 420e135 into flutter:main Jul 2, 2026
88 checks passed
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: material_ui triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants