getRealIndexFromRenderIndex static method

int getRealIndexFromRenderIndex({
  1. bool reverse = false,
  2. int index = 0,
  3. int itemCount = 0,
  4. bool loop = false,
})

Implementation

static int getRealIndexFromRenderIndex(
    {bool reverse = false, int index = 0, int itemCount = 0, bool loop = false}) {
  int initPage = reverse ? (itemCount - index - 1) : index;
  if (loop) {
    initPage += kMiddleValue;
  }
  return initPage;
}