flutter_slidable
flutter_slidable copied to clipboard
How to animate last dismissable action?
I'm looking to treat the outer action (last action) as the dismissable. I'm trying to implement an animation that expresses this but bridging the gap between the dismissable logic and the action pan logic seems impossible. If I create a custom SlidableDrawerDismissal that animates an expansion of the outer action item to the full size of the sliddable, the animation will disappear when the user drags back to the initial half of the page. Is there anyway to get around this?
I'm not sure to understand what you want. Have you a sample code? You can create your own Dismissal if you want to achieve a particular effect.
I think this is the behavior he is describing. I am wondering the same. Would it be possible to do something like this?
https://user-images.githubusercontent.com/19904063/119657954-e1bc8900-be2c-11eb-981b-969432944848.MP4
The is the default behavior in 1.0. The animation is not the same though, but it can be done.
The is the default behavior in 1.0. The animation is not the same though, but it can be done.
Can you give an example on how to do it?
Slidable(
key: ValueKey(widget.index),
endActionPane: ActionPane(
motion: const ScrollMotion(),
extentRatio: 0.25,
children: [
SlidableAction(
onPressed: (context) {},
backgroundColor: Color(0xFFFE4A49),
foregroundColor: Colors.white,
icon: Icons.delete,
label: 'Sil',
),
],
)
Use a DismissiblePane in the ActionPane to be able to dismiss it.