gridIndicies static method

  1. @visibleForTesting
List<int> gridIndicies(
  1. int index,
  2. int columns,
  3. int count
)

Implementation

@visibleForTesting
static List<int> gridIndicies(int index, int columns, int count) {
  final rows = _rows(columns, count);
  final maxItemsForGridSize = columns * rows;
  final yIndex = (index / maxItemsForGridSize * rows).floor();
  final xIndex = index % columns;
  return [xIndex, yIndex];
}