[material_ui] Migrate api sample code to @example dartdoc directive#12078
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ** |
There was a problem hiding this comment.
++
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 ** |
There was a problem hiding this comment.
Piinks
left a comment
There was a problem hiding this comment.
The analyzer failure is just the @example directive not being recognized, so it just needs that override from the sample PR. 👍
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
|
#12063 landed with the |
3b78628 to
baf03c2
Compare
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.
Migrates @tool directives to @example in material_ui
Towards flutter/flutter#172936 and flutter/flutter#172937
Prerequisite:
Related:
cupertino_uiPre-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