[material_ui, cupertino_ui] Migrate several doc directives for demonstration#11975
[material_ui, cupertino_ui] Migrate several doc directives for demonstration#11975dkwingsmt wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the documentation in menu_anchor.dart and carousel.dart by replacing old tool blocks with {@example} directives and adding several TODO comments. The review feedback highlights that using regular comments (//) instead of doc comments (///) within documentation blocks breaks their contiguity, which can detach the API documentation. Additionally, the reviewer notes that the {@example} paths should not start with a leading slash to prevent resolution failures.
| // TODO(dkwingsmt): Replace the following block with a blue example container | ||
| // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 | ||
| /// | ||
| /// {@tool dartpad} |
There was a problem hiding this comment.
The dartpads that you have removed appear to now be exactly the same as the samples that you removed (if I'm not overlooking something). Don't you need to distinguish the two so that we can add back the dartpads later?


This PR migrates several doc directives to reach agreement before I perform a mass search-and-replace throughout the codebase.
To be exact, this PR migrates one
{@tool snippet}directive, one{@tool dartpad}directive, and two{@tool sample}directives (which are actually allsampleusages throughout the codebase).The TODO comments are left for features to be implemented by the Dart team or unit tests that do not block the initial release.
Result
The result looks like this:

and
Known issue 1: No max-height for code snippets
It is a known flaw that the code blocks do not have a max height. The API doc page will display full source code, which is harder to read.
Solve it requires extra CSS rules, which is included in a previous proposal dart-lang/dartdoc#4243.
Known issue 2:
dart analyzedoes not recognize theexampledirectiveEven though
dartdochas supported theexampledirective,dart analyzestill does not recognize it, causing warnings in IDE and CI. A PR dart-lang/sdk#63646 has been opened to solve this. Before the fix is landed in (hopefully) the next Dart version, we'll have to ignore this rule.Pre-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