-
-
Notifications
You must be signed in to change notification settings - Fork 626
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
On tap trigger dismiss animation? #31
Comments
It would be good to also listen for drag start event, to prevent other list items from being spam dismissed. I'm trying to only let one draggable be dismissed at a time. |
Ok I figured out how to allow dismissing only 1 |
To dismiss only 1 row at a time, you can also set a For the dismiss on tap, you can look to #19 (comment) 😃 . I should add this in the readme though. |
@letsar thanks for responding - I got a error:
|
I fixed it by using |
Have you a code sample to let me reproduce the issue? I've just tried again the example in the comment, and it's working in my example. |
@letsar I am reopening this, I am unable to dismiss (nothing happens when I try to call dismiss, no error either) here's some code:
|
Hi @abacaj, I found how to reproduce, I will look into it. |
One workaround while I'm fixing it, would be to set |
thank you for looking into it! |
Fix published in version 0.4.7 |
For anyone who ends up down this rabbit hole and still cannot get a tap to trigger a dismiss try this. Took me a while to figure it out but just change the child to your slideable item and adjust according to your theme and this should work!
|
Feels like this should be a default or a toggle option. |
@letsar correct that this feature is not yet implanted on the 1.0.0-dev version? The dimiss() now requires ResizeRequest, it this correct? |
@bct-fbo it wasn't available from outside, but I've just made a small improvement to be able to do it. SlidableAction(
autoClose: false,
onPressed: (context) {
final controller = Slidable.of(context);
controller.dismiss(
ResizeRequest(const Duration(milliseconds: 300), () {
// Write the code to really remove the widget from the tree.
}),
duration: const Duration(milliseconds: 300),
);
},
backgroundColor: Color(0xFFFE4A49),
foregroundColor: Colors.white,
icon: Icons.delete,
label: 'Delete',
), Download the 1.0.0-dev.4 version to be able to do it. |
Awesome! Thank you very much! |
Great widget library!
Is it possible to trigger the dismiss animation of the
Slidable
when a user taps aSlideAction
?Something like:
The text was updated successfully, but these errors were encountered: