verticalDragEnd method

void verticalDragEnd(
  1. DragEndDetails details
)

Function for onPanEnd when the dragAxis is DragAxis.vertical.

Implementation

void verticalDragEnd(DragEndDetails details) {
  final velocity = details.velocity.pixelsPerSecond.dy.abs();
  if (velocity >= 100) {
    isFront = !isFrontStart;
  }
  animationVertical = Tween<double>(
    begin: dragVertical,
    end: isFront ? (dragVertical > 180 ? 360 : 0) : 180,
  ).animate(animationController);
  animationController.forward(from: 0);
}