-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add ScrollDragDismissable widget for drag-to-dismiss functionality #216
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
base: main
Are you sure you want to change the base?
Conversation
|
Dude this is amazing, I've had this on my to do list! I hope I find time to test this out this week 🤩 |
timcreatedit
left a comment
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.
Thanks for this! I only have two small comments, but otherwise LGTM! If possible, I'd love one or two tests on this, but no pressure, we can add them later
| /// Set this to false when your scrollable cannot move backwards (e.g. a | ||
| /// sheet is fully expanded) to allow this child's scrollable to transition | ||
| /// back to scrolling instead of dragging. | ||
| final bool scrollableCanMoveBack; |
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.
This parameter should probably not be exposed. Instead we should set it based on the current dismiss progress. If dismiss progress is 0, the scrollable can't move further back, but if it is > 0 it can
| flutter: | ||
| sdk: flutter | ||
| motor: ^1.0.1 | ||
| scroll_drag_detector: ^0.0.4 |
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.
could you update this to the latest dependency?
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.
that's also the reason the CI seems to be failing :)
|
hey @ShashankSMayya! Would you mind if I finish this up? Or do you have some time? I actually really love the idea and would kind of need it in one of my own projects |
|
Hey, I don't mind if you do it too. If not, I'll check it over this weekend if that works. I've been a bit busy last few weeks, sorry for the delay. |
Description
This pull request introduces a new widget,
ScrollDragDismissable, which enables drag-to-dismiss functionality for scrollable content, similar to bottom sheet behavior. The implementation integrates this widget into the example app to enhance user interaction, and updates the package exports and dependencies accordingly.New drag-to-dismiss functionality for scrollable content:
ScrollDragDismissablewidget inscroll_drag_dismissable.dart, which allows scrollable widgets to be dismissed by dragging, handling gesture transitions between scrolling and dismissal, and integrating withHeroineVelocityfor smooth transitions.ScrollDragDismissablefrom the package inheroine.dartfor public use.scroll_drag_detectordependency to support gesture detection for the new widget.Integration into example app:
SecondDetailsPagein the example to use a scrollableListViewinstead of a staticCenterwidget, providing a better demonstration of scrollable drag-to-dismiss.DragDismissablewithScrollDragDismissablein the example's custom route, disablingscrollableCanMoveBackto match the intended UX.Checklist