Skip to content

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

Open
dkwingsmt wants to merge 6 commits into
flutter:mainfrom
dkwingsmt:demo-snippet-test-checkbox
Open

[cupertino_ui] Migrate a snippet in CupertinoCheckbox's API doc to {@example} and add unit tests#12180
dkwingsmt wants to merge 6 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
@dkwingsmt dkwingsmt marked this pull request as ready for review July 13, 2026 05:01

@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 extracts an inline code snippet for CupertinoCheckbox into a standalone example file and adds a corresponding widget test. The documentation in checkbox.dart is updated to reference this external snippet. A compilation error was identified in the test file where .light is used instead of Brightness.light.

@dkwingsmt dkwingsmt added the CICD Run CI/CD label Jul 13, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jul 13, 2026
@dkwingsmt dkwingsmt added the CICD Run CI/CD label Jul 13, 2026
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 triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant