scrollToIndex method

void scrollToIndex()

Implementation

void scrollToIndex() async {
  int index = getList().indexWhere((element) => element.id == selectedItemId);

  await scrollController.scrollToIndex(
    index,
    duration: const Duration(milliseconds: 100),
    preferPosition: AutoScrollPosition.middle,
  );

  setState(() {
    isVisibile = true;
  });
}