Skip to content

[cupertino_ui] Adopt code excerpts in README - #13400

Merged
auto-submit[bot] merged 10 commits into
flutter:mainfrom
Bhagyaprasad92:docs/cupertino-ui-code-excerpts
Nov 22, 2026
Merged

auto-submit[bot] merged 10 commits into
flutter:mainfrom
Bhagyaprasad92:docs/cupertino-ui-code-excerpts

Conversation

@Bhagyaprasad92

@Bhagyaprasad92 Bhagyaprasad92 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR adopts the repository's code-excerpt mechanism for the documentation examples in the cupertino_ui package.

Changes

  • Adds example/lib/readme_excerpts.dart as the maintained source for the app-wide compatibility bridge, subtree compatibility bridge, and Dartdoc example snippets.
  • Updates packages/cupertino_ui/README.md and packages/cupertino_ui/example/README.md to generate their Dart code examples from named source regions.
  • Removes the obsolete exempt_from_excerpts: true configuration from ci_config.yaml, enabling README excerpt enforcement for this package.
  • Corrects the installation command's code fence from dart to sh.
  • Adds a pending changelog entry with version: patch, following the package's batch-release process.
  • Adds smoke tests in example/test/readme_excerpts_test.dart to verify the app-wide and subtree compatibility bridge examples.

These changes keep the published documentation examples synchronized with maintained source code and allow the repository's excerpt validation to detect inconsistencies.

Related issue

Part of [flutter/flutter#102679] - Adopt code-excerpt across all READMEs.

Validation

Validation performed after synchronizing with the latest PR branch:

  • fvm flutter analyze - passed with no issues.
  • fvm flutter test test/readme_excerpts_test.dart - passed. 2 tests passed.
  • fvm flutter test - passed. 132 tests passed, 2 skipped.
  • Working tree was clean before pushing the changes.

Earlier package validation:

  • Package tests: 1,959 passed, 6 skipped.
  • Example tests: 130 passed, 2 skipped, before the additional smoke tests were added.
  • General package validation with --no-check-for-missing-changes passed.
  • git diff --check passed.

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 the 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

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If both you and the PR author believe this PR qualifies for a test exemption, escalate to the tech lead for the changed area to review and apply the test-exempt label. All reviewers should feel empowered to ask for tests before escalating.

@github-actions github-actions Bot added p: cupertino_ui triage-design Should be looked at in design triage labels Oct 23, 2026
@google-cla

google-cla Bot commented Oct 23, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@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 the code snippets from the README.md into a separate readme_excerpts.dart file using <?code-excerpt?> tags. The review feedback suggests using const when instantiating LegacyPackageWidget in both the code and the README to follow Dart style guidelines.

Comment thread packages/cupertino_ui/README.md Resolved
@Bhagyaprasad92

Copy link
Copy Markdown
Contributor Author

I've addressed the const suggestion in commit c95acf3 and regenerated the README excerpts.

Validation:

  • update-excerpts --packages cupertino_ui — passed
  • analyze --packages cupertino_ui — passed with no issues
  • git diff --check — passed

Since this change adds maintained source excerpts for README documentation without changing runtime behavior, would it qualify for a test exemption? Please let me know if you recommend any additional validation or changes.

@Bhagyaprasad92
Bhagyaprasad92 force-pushed the docs/cupertino-ui-code-excerpts branch from c95acf3 to 0b2ecc5 Compare October 24, 2026 05:46
@Bhagyaprasad92

Copy link
Copy Markdown
Contributor Author

Update: I rebased this PR onto the latest upstream/main to address the outdated-branch status. The changes are now in commits c8be0c9 and 0b2ecc5. I've rerun the README excerpt generator and package analyzer successfully.

@QuncCccccc
QuncCccccc requested a review from dkwingsmt November 3, 2026 22:23
@QuncCccccc

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Because of the volume of PRs we receive, we require that new contributors use our checklist to guide them through critical steps in creating a Flutter PR. This PR's description is missing that checklist, so it is being marked as a Draft.

Please edit the PR description to add the checklist, then ensure that you have completed all of the steps. Once you've done that, please mark the PR as ready for review.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@QuncCccccc
QuncCccccc marked this pull request as draft November 3, 2026 22:24
@QuncCccccc
QuncCccccc removed the request for review from dkwingsmt November 3, 2026 22:24
@Bhagyaprasad92
Bhagyaprasad92 force-pushed the docs/cupertino-ui-code-excerpts branch from 474a49e to a3a6a9b Compare November 4, 2026 18:43
@Bhagyaprasad92
Bhagyaprasad92 force-pushed the docs/cupertino-ui-code-excerpts branch from a3a6a9b to dfd613a Compare November 4, 2026 19:16
@Bhagyaprasad92
Bhagyaprasad92 marked this pull request as ready for review November 4, 2026 19:23

@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 transitions the cupertino_ui package README files to use generated code excerpts. It removes the excerpt exemption from the CI configuration, adds a new readme_excerpts.dart file containing the source code for the excerpts, and updates the markdown files with excerpt markers. Feedback on the changes suggests removing an unnecessary // ignore_for_file: deprecated_member_use lint ignore from the newly added Dart file.

@Bhagyaprasad92

Copy link
Copy Markdown
Contributor Author

Thank you for your contribution! Because of the volume of PRs we receive, we require that new contributors use our checklist to guide them through critical steps in creating a Flutter PR. This PR's description is missing that checklist, so it is being marked as a Draft.

Please edit the PR description to add the checklist, then ensure that you have completed all of the steps. Once you've done that, please mark the PR as ready for review.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Thanks for the guidance!

I've updated the PR description with the required checklist, completed the applicable steps, and marked the PR as ready for review.

I've also documented the test-exemption request since this PR only changes documentation and code-excerpt generation, without modifying runtime behavior. The existing package and example test suites passed.

I understand that the test exemption requires maintainer approval. Please let me know if any further changes are needed.

Thank you!

@Bhagyaprasad92

Copy link
Copy Markdown
Contributor Author

Hi,

Just following up on this PR. It has been marked ready for review since November 4, and I've synchronized the branch with the latest upstream main.
The PR currently shows one approving review still required and two GitHub Actions workflows awaiting maintainer approval.

Since this is a documentation and code-excerpt-only change, the existing package and example test suites have completed successfully. Could a maintainer please advise whether this change qualifies for the test-exempt label and approve the pending workflow runs where appropriate?

Please let me know if any further changes or validation are required.

Thank you for your time.

@dkwingsmt dkwingsmt 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.

Sorry for late review!

Generally ok, and thanks for the fix. I'd like that we also add a unit test (just smoke tests are fine) at example/test/readme_excerpts_test.dart so that excerpts are actually tested, the way we take the trouble for. I've drafted one for your convenience.

Details
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// The README snippets intentionally demonstrate the deprecated migration
// utility.
// ignore_for_file: deprecated_member_use

import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:cupertino_ui_examples/readme_excerpts.dart'
    show LegacyPackageWidget, MyApp, SubtreeExample;
import 'package:flutter_test/flutter_test.dart';

void main() {
  testWidgets('AppWideUsage wraps the whole app in the bridge', (
    WidgetTester tester,
  ) async {
    await tester.pumpWidget(const MyApp());

    expect(find.byType(CupertinoUiCompatibilityBridge), findsOneWidget);
    expect(
      find.descendant(
        of: find.byType(CupertinoUiCompatibilityBridge),
        matching: find.text('Home'),
      ),
      findsOneWidget,
    );
    expect(tester.takeException(), isNull);
  });

  testWidgets('SubtreeUsage wraps only the legacy subtree in the bridge', (
    WidgetTester tester,
  ) async {
    await tester.pumpWidget(const CupertinoApp(home: SubtreeExample()));

    expect(find.text('Modern Screen'), findsOneWidget);
    expect(find.byType(CupertinoUiCompatibilityBridge), findsOneWidget);
    expect(
      find.descendant(
        of: find.byType(CupertinoUiCompatibilityBridge),
        matching: find.byType(LegacyPackageWidget),
      ),
      findsOneWidget,
    );
    // The navigation bar is outside the bridge.
    expect(
      find.descendant(
        of: find.byType(CupertinoUiCompatibilityBridge),
        matching: find.text('Modern Screen'),
      ),
      findsNothing,
    );
    expect(find.text('Legacy package widget'), findsOneWidget);
    expect(tester.takeException(), isNull);
  });
}

@github-actions
github-actions Bot marked this pull request as draft November 19, 2026 10:30
@github-actions github-actions Bot added the waiting for response The Flutter team cannot make further progress on this PR until the author responds label Nov 19, 2026
@github-actions

Copy link
Copy Markdown

Hi @Bhagyaprasad92, thank you for your contribution!

This pull request has been converted to a draft because it does not appear to follow our pull request template:

  • Missing or modified checklist items (7 of 11): The following expected items were not found in the PR description (please keep the original checklist text without deleting or rewording items):
    • - [ ] I read the [Tree Hygiene] page, which explains my responsibilities.
    • - [ ] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]`
    • - [ ] I [linked to at least one issue that this PR fixes] in the description above.
    • - [ ] I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1].
    • - [ ] I updated/added any relevant documentation (doc comments with `///`).
    • - [ ] I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
    • - [ ] All existing and new tests are passing.

How to fix this

  1. Click the ... menu in the top-right corner of your PR description above and select Edit.
  2. Address the issues listed above. Make sure every item in the Pre-Review Checklist is present without modifications and checked off (- [x]).
  3. Save your changes, then click the "Ready for review" button at the bottom of the PR.
Click here for the raw Markdown of the Pre-Review Checklist to copy and paste
## Pre-Review Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
- [ ] I read the [Tree Hygiene] page, which explains my responsibilities.
- [ ] I read and followed the [relevant style guides] and ran [the auto-formatter].
- [ ] I signed the [CLA].
- [ ] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]`
- [ ] I [linked to at least one issue that this PR fixes] in the description above.
- [ ] I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1].
- [ ] I updated/added any relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
- [ ] All existing and new tests are passing.

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](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.

<!-- Links -->
[Contributor Guide]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
[AI contribution guidelines]: https://github.com/flutter/flutter/blob/master/CONTRIBUTING.ai.md#pull-requests
[Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[relevant style guides]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style
[the auto-formatter]: https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code
[CLA]: https://cla.developers.google.com/
[Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[the version and CHANGELOG instructions]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates
[semantic versioning]: https://dart.dev/tools/pub/versioning#semantic-versions
[repository CHANGELOG style]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style
[test exemption]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests

@Bhagyaprasad92
Bhagyaprasad92 marked this pull request as ready for review November 19, 2026 10:46

@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 updates the cupertino_ui package to use generated code excerpts in its README files. It removes the exempt_from_excerpts flag from the CI configuration, introduces a new readme_excerpts.dart file containing the excerpt sources, and adds widget tests in readme_excerpts_test.dart to verify the excerpted code. A review comment suggests refactoring the SubtreeUsage docregion in readme_excerpts.dart to enclose the entire return statement, which simplifies the formatting.

@github-actions github-actions Bot removed the waiting for response The Flutter team cannot make further progress on this PR until the author responds label Nov 19, 2026
@dkwingsmt dkwingsmt added the CICD Run CI/CD label Nov 19, 2026
Comment thread packages/cupertino_ui/README.md Resolved
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 20, 2026
@dkwingsmt dkwingsmt added the CICD Run CI/CD label Nov 20, 2026
dkwingsmt
dkwingsmt previously approved these changes Nov 20, 2026

@dkwingsmt dkwingsmt 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

pjkammer
pjkammer previously approved these changes Nov 20, 2026

@pjkammer pjkammer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM.

@Bhagyaprasad92
Bhagyaprasad92 dismissed stale reviews from pjkammer and dkwingsmt via 5567933 November 21, 2026 04:48
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 21, 2026
@Bhagyaprasad92

Copy link
Copy Markdown
Contributor Author

Thanks for the approval @dkwingsmt and could someone also re-apply the CICD label and approve the pending workflows so the checks can run?

@pjkammer pjkammer added the CICD Run CI/CD label Nov 22, 2026
@pjkammer pjkammer added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 22, 2026
@auto-submit
auto-submit Bot merged commit 484e838 into flutter:main Nov 22, 2026
14 checks passed
@Bhagyaprasad92
Bhagyaprasad92 deleted the docs/cupertino-ui-code-excerpts branch November 22, 2026 03:21
YeungKC pushed a commit to YeungKC/flutter that referenced this pull request Nov 23, 2026
…r#197216)

flutter/packages@898818d...5b93485

2026-11-22 [email protected] Roll Flutter from
5423f94 to 685f4cf (3 revisions) (flutter/packages#13754)
2026-11-22 [email protected]
[cupertino_ui] Adopt code excerpts in README (flutter/packages#13400)
2026-11-21 [email protected] Roll Flutter from
b34b017 to 5423f94 (24 revisions) (flutter/packages#13747)
2026-11-21 [email protected] [material_ui] Make tests independent of
the default scroll cache extent (flutter/packages#13715)
2026-11-20 [email protected] Roll Flutter (stable) from
ab29120 to ae9b586 (13 revisions) (flutter/packages#13738)
2026-11-20 [email protected] [camera_android_camerax] Only set the
ImageCapture flash mode when it changes (flutter/packages#13468)
2026-11-20 [email protected] Roll Flutter from
e8cc6f3 to b34b017 (36 revisions) (flutter/packages#13737)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
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: cupertino_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants