closeWithAnim method

Future<void> closeWithAnim()

close this cell and return the Future of the animation

Implementation

Future<void> closeWithAnim() async {
  //when close animation is running,ignore action button hit test
  ignoreActionButtonHit = true;
  _resetAnimValue();
  if (mounted) {
    animation =
        Tween<double>(begin: currentOffset.dx, end: 0.0).animate(curvedAnim)
          ..addListener(() {
            if (lockAnim) return;
            this.currentOffset = Offset(animation.value, 0);
            setState(() {});
          });

    return controller.forward()
      ..whenCompleteOrCancel(() {
        ignoreActionButtonHit = false;
      });
  }
}