Code Monkey home page Code Monkey logo

Comments (15)

DARdk avatar DARdk commented on June 5, 2024 5

Amazing! Thanks both. I added your version to my pubspec.yaml, and change from Slidable to Slidable.builder. Then wrapped the child of Slidable.builder inside a builder like:
child: new Builder(builder: (contextNew) => new Column(....)
And it perfectly animates the slide-effect for my secondaryactions during onTap.
However, somehow I need to slide it the first time to make it "recognize" the object, THEN a onTap will slide it out. But If I entered the page and directly press it: Nothing happens... Any clue?
Thanks a lot.

from flutter_slidable.

ZionPi avatar ZionPi commented on June 5, 2024 4

How to check if the Slidable Item is opened or closed?

from flutter_slidable.

letsar avatar letsar commented on June 5, 2024 3

If Slidable.of(context) was null, it's maybe because the context is a parent of the Slidable. It can be related to
https://stackoverflow.com/questions/51304568/scaffold-of-called-with-a-context-that-does-not-contain-a-scaffold/51304732

Thank you, I will keep you posted on my advancement πŸ™‚ .

from flutter_slidable.

DARdk avatar DARdk commented on June 5, 2024 2

@miDeb Yes, I did not add the actionType. By adding it as: Slidable.of(context).open(actionType: SlideActionType.secondary);
It works every time! Thanks, this is perfect

from flutter_slidable.

miDeb avatar miDeb commented on June 5, 2024 1

@DARdk are you calling open() without the actionType?

from flutter_slidable.

armandojimenez avatar armandojimenez commented on June 5, 2024 1

How can I check if the slideable is already open to close it?

from flutter_slidable.

letsar avatar letsar commented on June 5, 2024

I see. This widget wasn't created with this kind of feature in mind. I need to rewrote some parts in order to be animated by sliding or with a call to a function.
For the moment, you can call Slidable.of(context) inside the child of a Slidable to get its state and call open(). But you won't get any animation and you won't be able to tell whether you want to open the primary or secondary actions.
I won't be able to do it now, but give me some time and I will do it πŸ™‚.

from flutter_slidable.

DARdk avatar DARdk commented on June 5, 2024

Thank you for the prompt answer letsar.
I did not have any luck with your suggestion (my child of Slidable is a ListTile). The Slidable.of(context) was null in all cases.
However, I will just implement a in-app guidance, and keep this functionality as a future feature. Thank you for considering this enhancement in a future version.

from flutter_slidable.

miDeb avatar miDeb commented on June 5, 2024

I've implemented a solution for this on my fork, so if you could have a look...
Note that I've also made some other changes.
Perhaps I've broken something😁.

from flutter_slidable.

letsar avatar letsar commented on June 5, 2024

Great. I've been working on a complete refactor of the API (you can see the work in progress in the https://github.com/letsar/flutter_slidable/tree/feature/refactor branch) and I added the feature to animate on when opening. I will keep you posted on the advancement.

from flutter_slidable.

enzoftware avatar enzoftware commented on June 5, 2024

@DARdk thanks so much, you save me!

from flutter_slidable.

letsar avatar letsar commented on June 5, 2024

Closing as this is resolved

from flutter_slidable.

saigopin avatar saigopin commented on June 5, 2024

@armandojimenez any solution?

from flutter_slidable.

armandojimenez avatar armandojimenez commented on June 5, 2024

I use this:

if (Slidable.of(context)!.renderingMode == SlidableRenderingMode.none) {
              Slidable.of(context)!.open(actionType: SlideActionType.secondary);
} else {
              Slidable.of(context)!.close();
}

When I tap the cell, it opens or close depending if it's already open. Do only weird issue, is that if I open it via a tap, and them try to close it by sliding, it does without animation, and looks weird. But if you closed it back by tap it works fine.

from flutter_slidable.

gopibathini avatar gopibathini commented on June 5, 2024

@armandojimenez what should instead of rendering mode in latest null satety version 1.0.0. I want to open the slider at a time on tapping the list item , when i tap on second item , first item just closes its slide but second item not opening it slide

from flutter_slidable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.