getTraversalSteps method

int getTraversalSteps(
  1. PageDLLTraversalDirection direction, [
  2. PageDLLData? pageDLLData,
  3. dynamic i = 0
])

Implementation

int getTraversalSteps(PageDLLTraversalDirection direction,
    [PageDLLData? pageDLLData, i = 0]) {
  final page = pageDLLData ?? this;

  if (direction == PageDLLTraversalDirection.left) {
    if (page.isFirstPage()) return i;
    return getTraversalSteps(direction, page.previousPage, i + 1);
  } else {
    if (page.isLastPage()) return i;
    return getTraversalSteps(direction, page.nextPage, i + 1);
  }
}