-
Notifications
You must be signed in to change notification settings - Fork 22
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 StretchingSheetPhysics to limit stretchable direction #159
Comments
Is there also a way to specify the max stretch distance? |
Would it be a hard stop when pulling up, or still give a Bouncing effect? |
I'd love to have max stretch like @appinteractive suggested. In the native sheet, the stretch stops at the reduced parent page limits. Here's the behavior of a basic sheet in SwiftUI: swiftui-sheet.mp4Source code: https://gist.github.com/habibasseiss/d14c375c40b6a543a8043d2aedc00c36 Having that in addition to the sheet attaching the bottom would be amazing! |
StretchingSheetPhysics.stretchingRange could be used for this purpose. It determines how many pixels the sheet can be overdragged. (Sorry for the lack of documentation, I'll try to get it done before the first stable release.) // Overdragging is disabled.
StretchingSheetPhysics(stretchingRange: const Extent.pixels(0));
// The sheet can be overdragged by ±100 pixels.
StretchingSheetPhysics(stretchingRange: const Extent.pixels(100));
// The sheet can be overdragged by ±10% of the sheet height.
StretchingSheetPhysics(stretchingRange: const Extent.proportional(0.1)); I think it would be nice to allow this property to be set for each direction. |
That's a great idea! |
I think another effort is needed to achieve this behavior... |
Hi @habibasseiss,
Thanks for the suggestion! I agree with this idea and so I will add an option to
StretchingSheetPhysics
to limit the directions in which the sheet can stretch.Originally posted by @fujidaiti in #157 (comment)
The text was updated successfully, but these errors were encountered: