isValidIndex method

bool isValidIndex(
  1. int index
)

Whether an index is within the item count.

Implementation

bool isValidIndex(int index) => index >= 0 && index < itemCount;