jumpTo method

void jumpTo({
  1. required double offset,
})

Implementation

void jumpTo({
  required double offset,
}) async {
  if (shrinkWrap) {
    return scrollController.jumpTo(
      offset.clamp(
        scrollController.position.minScrollExtent,
        scrollController.position.maxScrollExtent,
      ),
    );
  }

  itemScrollController.jumpTo(
    index: max(0, offset.toInt()),
    alignment: 0.5,
  );
}