snapToTop method

Future<void> snapToTop(
  1. ITreeNode<Data> item, {
  2. Duration delay = animationDuration,
})

Implementation

Future<void> snapToTop(ITreeNode<Data> item,
    {Duration delay = animationDuration}) async {
  await Future.delayed(delay);

  await scrollController.scrollToIndex(
    animatedListStateController.indexOf(item),
    preferPosition: AutoScrollPosition.begin,
  );
}