endIndex method

int endIndex(
  1. int totalItems
)

Returns the exclusive end index for the current page.

Implementation

int endIndex(int totalItems) {
  if (!enabled) return totalItems;
  return math.min(startIndex(totalItems) + pageSize, totalItems);
}