calculate method

  1. @override
void calculate(
  1. int index,
  2. ScrollProgress info
)
override

Implementation

@override
void calculate(int index, ScrollProgress info) {
  if (info.dir == -1 && info.targetIndex == index) {
    scale = 1 - info.progress;
    return;
  }

  if (info.dir == -1 && info.currentIndex == index) {
    scale = info.progress;
    return;
  }

  if (info.dir == 1 && info.targetIndex == index) {
    scale = info.progress;
    return;
  }

  if (info.dir == 1 && info.currentIndex == index) {
    scale = 1.0 - info.progress;
    return;
  }

  scale = 0;
}