flutter_slidable icon indicating copy to clipboard operation
flutter_slidable copied to clipboard

Slidable status (open/close)

Open loic-hamdi opened this issue 3 years ago • 4 comments

Hi, How can we know which pane is currently open or close?

loic-hamdi avatar Oct 01 '23 03:10 loic-hamdi

Same question I need to know this as it seems the author remove the Slidable.builder in the package.

garlen-javier avatar Oct 26 '23 14:10 garlen-javier

Try with Slidable.of(context)!.closing check for more

ankainn avatar Nov 24 '23 09:11 ankainn

Stateful class with SingleTickerProviderStateMixin

late final SlidableController _controller;

void initState() { _controller=SlidableController(this); super.initState();

} //Add controller to slidable

void FunctionIsOpen(){ if(controller.actionPaneType.value==ActionPaneType.none){ //slider is close } else { //Slider is open } }

volusanmaz avatar Dec 27 '24 11:12 volusanmaz

Pass a controller with Slidable(controller: controller, ...) and read controller.actionPaneType.value (ActionPaneType.none means closed). It is a ValueNotifier, so you can also listen to it. controller.animation gives the exact ratio.

letsar avatar Oct 31 '26 17:10 letsar