zeros method

List zeros(
  1. int row,
  2. int cols
)

Return a new array of given shape, with zeros

var zeros = m2d.zeros(2,2);
print(zeros);
//[[0, 0], [0, 0]]

Implementation

List zeros(int row, int cols) =>
    List.filled(row, 0).map((e) => List.filled(cols, 0)).toList();