diff --git a/lib/src/slidable.dart b/lib/src/slidable.dart index a0a3804..cf5f297 100644 --- a/lib/src/slidable.dart +++ b/lib/src/slidable.dart @@ -28,12 +28,16 @@ class Slidable extends StatefulWidget { this.direction = Axis.horizontal, this.dragStartBehavior = DragStartBehavior.down, this.useTextDirection = true, + this.onSlideAnimationChanged, required this.child, }); /// The Slidable widget controller. final SlidableController? controller; + /// A callback that is called when the slide animation changes. + final Function(Animation animation)? onSlideAnimationChanged; + /// Whether this slidable is interactive. /// /// If false, the child will not slid to show actions. @@ -214,6 +218,9 @@ class _SlidableState extends State : Offset(0, end), ), ); + if (widget.onSlideAnimationChanged != null) { + widget.onSlideAnimationChanged!(moveAnimation); + } } Widget? get actionPane {