-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to dynamically enable bottom sheet drag for a single page #45
Conversation
f5c2d72
to
d85d6f4
Compare
49799e2
to
868dd80
Compare
@@ -118,6 +118,10 @@ class WoltModalSheetPage { | |||
/// `true`. | |||
final bool? hasSabGradient; | |||
|
|||
/// Controls the draggability of the bottom sheet. This setting overrides the value provided | |||
/// via [WoltModalSheet.show] specifically for this page when the modal is displayed as a bottom sheet. | |||
final bool? enableDragForBottomSheet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there is another enableDrag
property in the package. I'd suggest just enableDrag
.
The current name is too verbose IMO. The documentation should be enough to explain what enable drag is for.
See https://master-api.flutter.dev/flutter/material/BottomSheet/enableDrag.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
class SheetPageWithDynamicPageProperties { | ||
SheetPageWithDynamicPageProperties._(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is already being used. Short documentation will be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added docs here: 219fc21
Don't merge this PR before #44
Summary
This pull request introduces a new feature that enhances the behavior of the
WoltModalSheet
library by allowing the enabling or disabling of drag-to-dismiss functionality for the bottom sheet on a per-page basis. The primary change is the addition of theenableDragForBottomSheet
property within theWoltModalSheetPage
class.Changes
enableDragForBottomSheet
to theWoltModalSheetPage
class.WoltBottomSheetDragHandle
to be conditionally displayed based on theenableDragForBottomSheet
property.playground
example app to demonstrate how to dynamically enable/disable drag for modal sheet.Use Case
This feature addition addresses a common use case where dynamic conditions dictate whether a bottom sheet can be dismissed by dragging or not. By providing this per-page option, developers can create more tailored and flexible user experiences, enabling or disabling the drag-to-dismiss behavior based on specific context and requirements.
Example
dynamic_property.mp4