maybe we can simply create reusable dart code.
void main(List<String> arguments) {
var list = createDimensionList(4, 5);
list[0][0] = 6;
print(list);
list[1][0] = 4;
print(list);
}
List<List<int>> createDimensionList(int rows, int columns,
{bool growable = false}) {
final columnLength = List<int>.filled(columns, 0, growable: growable);
var dataList =
List.generate(rows, (i) => columnLength.toList(), growable: growable);
return dataList;
}
//Output
[[6, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]
[[6, 0, 0, 0, 0], [4, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]