Dart List consisting of Lists (i.e. 2d array) weirdly linked
Advertisements I was just trying to create a 2D array in Dart as follows: List<List<int>> data = List.filled(7, List.filled(15, 0)); data[1][0] = 5; for (int i = 0; i< 7; i++) { print(‘Index $i: ${data[i]}’); } Expected result would be: Index 0: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,… Read More Dart List consisting of Lists (i.e. 2d array) weirdly linked