HandleScroll method

void HandleScroll(
  1. DragEndDetails d
)

On drag action, invia a scroll la direzione in cui scorrere

Implementation

void HandleScroll(DragEndDetails d) {
  final double dir = d.primaryVelocity ?? 0;
  if(dir > 0) scrollToIndex(currentIndex - 1);
  else if( dir < 0) scrollToIndex(currentIndex + 1);
}