[3.44] Account for deprecation of builder parameter of showCupertinoSheet#13362
Conversation
|
Visit the preview URL for this PR (updated for commit a729170): https://flutter-docs-prod--pr13362-fix-showcupertinosheet-buil-pak9uicr.web.app |
There was a problem hiding this comment.
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)
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)
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)
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)
Adding physics: const AlwaysScrollableScrollPhysics() ensures the sheet remains interactive via drag gestures even when the content is short.
controller: scrollController,
physics: const AlwaysScrollableScrollPhysics(),
sfshaza2
left a comment
There was a problem hiding this comment.
I know, still in draft, but lgtm
There was a problem hiding this comment.
Code Review
This pull request updates the showCupertinoSheet implementation in the Cupertino sheets cookbook example and documentation. It replaces the builder parameter with scrollableBuilder and ensures the provided scrollController is assigned to the SingleChildScrollView. I have no feedback to provide.
No description provided.