How to close Action Pane By clicking button in action pane Flutter Slidable

998 Views Asked by At

How to close Action Pane By clicking "No" button in action pane. I'm Using Flutter Slidable Package

3

There are 3 best solutions below

1
Dániel Rózsa On

First try to get the SlidableController from the context and you can close with that:

final SlidableController? controller = Slidable.of(context);
controller?.close();
1
Ankit Tale On

There is an basically code which you can use

    SlideAction({
    Key? key,
    required this.child,
    VoidCallback? onTap,
    Color? color,
    Decoration? decoration,
    bool closeOnTap = _kCloseOnTap,
  })

This can be use to perform operation on both button on No Button just set closeOnTap to true

1
Benny On

You need to use the SlidableAction Widget this fixed it for me