collapse method

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

collapse the index to the original position according to the openedPosition if the openedPosition is null, it would do nothing

Implementation

Future<void> collapse(
  int index, {
  required ActionPosition position,
  Curve curve = Curves.easeInOut,
  Duration duration = const Duration(milliseconds: 150),
}) async {
  switch (openedPosition) {
    case ActionPosition.pre:
      await preActionController?.collapse(
        index,
        curve: curve,
        duration: duration,
      );
      break;
    case ActionPosition.post:
      await postActionController?.collapse(
        index,
        curve: curve,
        duration: duration,
      );
      break;
    default:
      break;
  }
}