-
-
Notifications
You must be signed in to change notification settings - Fork 572
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 a SlidableController #6
Comments
This is maybe not the right solution, because we'll have to maintain a list of |
If this slide action is open, when I click on this item or other item, the slide action will be closed. When we click, we can traverse the other slide actions according to the keys. |
With the 0.3.0, I don't think we need a SlidableController now. |
I'm trying to open when user clicks on child context, for more exacty when ListTile onTap event, so I stucked because I tried all of these two methods, and of these, before I got the call to function I got null
|
Hi @hjJunior, Widget build(BuildContext context) => Slidable(
delegate: new SlidableDrawerDelegate(),
actionExtentRatio: 0.25,
closeOnScroll: false,
controller: slidableController,
child: new Builder(builder: buildChild),
actions: <Widget>[
new IconSlideAction(
caption: 'Archive',
color: Colors.blue,
icon: Icons.archive,
onTap: () => print('Archive'),
),
new IconSlideAction(
caption: 'Share',
color: Colors.indigo,
icon: Icons.share,
onTap: () => print('Share'),
),
]
); But I didn't design the animation to be programmatically called, so you will probably have an unexpected behavior. |
I have tried but keeps returning null :(
And the child
|
@hjJunior can you please, paste the minimal code to reproduce this? Because I tested it with a function or a another widget like you, want under a Builder, the |
@tidharnitzan Did it solve? I am also facing the same problem. |
Not AFAIK. Still waiting for a response from developer for the code snippet above. |
It's working in this code |
@tidharnitzan I got the problem. Instead, create slidableController in the controller itself and pass it to the cell and use it. |
@pushpendraKh - You are right! I'm still new to Flutter and totally missed that. all working great. thanks. ! |
any luck |
I need one Help I am using PopUpMenu in Slidable i want to close the slide when ever use clicks on PopupMenu item. |
Add this onTap() and call a separated widget in child property of Slidable and don't write child inside Slidable wid. onTap: () { //========= This is child in Slidable class _TempsState extends State { |
It worked for me <3 |
I'm having trouble getting the slidableController initialised. Looks to require a vsync param. I've done that with various animation controllers, but stuck here. Can someone give an example. I need to get the slidable to close when I swipe a different slidable, and need it to close when I tap a different slidable. Once I can get the slidableController initialised, I think I can take it from there. Thanks |
@BrianDevOK In latest version, SlidableController is not exposed and is meant to use internally. So, you can wrap your ListView in |
Thanks... I had tried the SlidableAutoCloseBehavior but not around the ListView. That took care of closing when swiping another item. How do I close it in this example: Swipe list item 1. Then tap on list item 2 In this example, my tap on list item 2 takes me to another view and when I hit back to my list, list item 1 is still open/slid. Thanks |
@BrianDevOK You are right. Currently, v1.1.0 does not solve this but the next version will definitely solve this automatically as the required change is already pushed in master branch here You can test the same in example project by running |
A
SlidableController
could open/close anySlidable
.This can be useful if we want to close
Slidable
s while scrolling, or if we want to close all the otherSlidable
s while opening one.The text was updated successfully, but these errors were encountered: