Skip to content

[3.44] Account for deprecation of builder parameter of showCupertinoSheet#13362

Draft
parlough wants to merge 1 commit intomainfrom
fix/showCupertinoSheet-builder
Draft

[3.44] Account for deprecation of builder parameter of showCupertinoSheet#13362
parlough wants to merge 1 commit intomainfrom
fix/showCupertinoSheet-builder

Conversation

@parlough
Copy link
Copy Markdown
Member

@parlough parlough commented May 6, 2026

No description provided.

@parlough parlough marked this pull request as ready for review May 6, 2026 15:15
@parlough parlough requested review from a team and sfshaza2 as code owners May 6, 2026 15:15
@parlough parlough marked this pull request as draft May 6, 2026 15:15
@flutter-website-bot
Copy link
Copy Markdown
Collaborator

Visit the preview URL for this PR (updated for commit 11b8c61):

https://flutter-docs-prod--pr13362-fix-showcupertinosheet-buil-f1vk0hhr.web.app

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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_sheets cookbook example and documentation to use scrollableBuilder instead of builder within showCupertinoSheet, ensuring the provided scrollController is correctly assigned to the SingleChildScrollView. Feedback suggests adding AlwaysScrollableScrollPhysics to the scrollable widgets to maintain interactivity via drag gestures even when content is short, and improving the documentation to explicitly mention the role of the ScrollController.

I am having trouble creating individual review comments. Click here to see my feedback.

examples/cookbook/design/cupertino_sheets/lib/main.dart (36)

medium

When using scrollableBuilder, it is highly recommended to set physics: const AlwaysScrollableScrollPhysics() on the scrollable widget (like SingleChildScrollView). This ensures that the sheet remains interactive and can be dismissed by dragging down even if the content is smaller than the screen height, as the scrollController needs the scroll view to be active to track the gesture.

                  controller: scrollController,
                  physics: const AlwaysScrollableScrollPhysics(),

sites/docs/src/content/cookbook/design/cupertino-sheets.md (45)

medium

Consider mentioning that the scrollableBuilder provides a ScrollController which must be passed to the scrollable widget to ensure proper gesture handling for the sheet.

To show it, call `showCupertinoSheet` and provide a `scrollableBuilder` (which provides a `ScrollController` for the content)

sites/docs/src/content/cookbook/design/cupertino-sheets.md (54)

medium

Adding physics: const AlwaysScrollableScrollPhysics() ensures the sheet remains interactive via drag gestures even when the content is short.

      controller: scrollController,
      physics: const AlwaysScrollableScrollPhysics(),

sites/docs/src/content/cookbook/design/cupertino-sheets.md (113)

medium

Adding physics: const AlwaysScrollableScrollPhysics() ensures the sheet remains interactive via drag gestures even when the content is short.

                  controller: scrollController,
                  physics: const AlwaysScrollableScrollPhysics(),

Copy link
Copy Markdown
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

I know, still in draft, but lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants