collapse method

Future<void> collapse(
  1. int index, {
  2. Curve curve = Curves.easeInOut,
  3. Duration duration = const Duration(milliseconds: 150),
})

collapse the index item to the original position

Implementation

Future<void> collapse(
  int index, {
  Curve curve = Curves.easeInOut,
  Duration duration = const Duration(milliseconds: 150),
}) async {
  if (_index == index) {
    await _animationController.fling(velocity: -1);

    _index = null;
  }
}