createMatrix<T> static method

List<List<T?>> createMatrix<T>(
  1. int rows,
  2. int cols,
  3. T? defaultValue
)

Implementation

static List<List<T?>> createMatrix<T>(int rows, int cols, T? defaultValue) {
  final grid = List<List<T?>>.generate(
      rows, (i) => List<T?>.generate(cols, (j) => defaultValue));
  return grid;
}