collapse method
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;
}
}