Skip to content

[cupertino_ui] Migrate a snippet in CupertinoCheckbox's API doc to {@example} and add unit tests#12180

Draft
dkwingsmt wants to merge 4 commits into
flutter:mainfrom
dkwingsmt:demo-snippet-test-checkbox
Draft

[cupertino_ui] Migrate a snippet in CupertinoCheckbox's API doc to {@example} and add unit tests#12180
dkwingsmt wants to merge 4 commits into
flutter:mainfrom
dkwingsmt:demo-snippet-test-checkbox

Conversation

@dkwingsmt

Copy link
Copy Markdown
Contributor

This PR demonstrates how to migrate an inline API documentation snippet into a separate file and verify it with unit tests.

Steps

  1. Create a new example file.
    • The file name should contain snippet.
    • The example file doesn't need a main function.
    • The widget body should contain the snippet, which is isolated by #region and #endregion directives.
    • If necessary, the file can have multiple regions. The region name doesn't have to be body.
  2. Add a corresponding test file to ensure the snippet functions correctly.
  3. Update the original documentation to use the new @example directive.
  4. Remove the TODO.

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

@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: cupertino_ui labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: cupertino_ui triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant