createIntMatrix static method

List<List<int>> createIntMatrix(
  1. int rows,
  2. int cols
)

Implementation

static List<List<int>> createIntMatrix(int rows, int cols) {
  final grid = List<List<int>>.generate(
      rows, (i) => List<int>.generate(cols, (j) => i * cols + j));
  return grid;
}