Repository navigation
[cupertino_ui] Adopt code excerpts in README - #13400
auto-submit[bot] merged 10 commits into
Conversation
|
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 |
|
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. |
There was a problem hiding this comment.
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.
|
I've addressed the Validation:
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. |
c95acf3 to
0b2ecc5
Compare
|
Update: I rebased this PR onto the latest |
|
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. |
474a49e to
a3a6a9b
Compare
a3a6a9b to
dfd613a
Compare
There was a problem hiding this comment.
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.
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! |
|
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 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 Please let me know if any further changes or validation are required. Thank you for your time. |
dkwingsmt
left a comment
There was a problem hiding this comment.
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);
});
}|
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:
How to fix this
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 |
There was a problem hiding this comment.
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.
5567933
|
Thanks for the approval @dkwingsmt and could someone also re-apply the CICD label and approve the pending workflows so the checks can run? |
…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
This PR adopts the repository's code-excerpt mechanism for the documentation examples in the
cupertino_uipackage.Changes
example/lib/readme_excerpts.dartas the maintained source for the app-wide compatibility bridge, subtree compatibility bridge, and Dartdoc example snippets.packages/cupertino_ui/README.mdandpackages/cupertino_ui/example/README.mdto generate their Dart code examples from named source regions.exempt_from_excerpts: trueconfiguration fromci_config.yaml, enabling README excerpt enforcement for this package.darttosh.version: patch, following the package's batch-release process.example/test/readme_excerpts_test.dartto 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.Earlier package validation:
--no-check-for-missing-changespassed.git diff --checkpassed.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 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
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