I have a 1d list of integers like:
List<int> x = [1, 4, 2, 8, 9, 3, 6, 5, 7];
I want to convert this list to a 2d list like this:
List<List<int>> y = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
I have a 1d list of integers like:
List<int> x = [1, 4, 2, 8, 9, 3, 6, 5, 7];
I want to convert this list to a 2d list like this:
List<List<int>> y = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
List<int> x = [1, 4, 2, 8, 9, 3, 6, 5, 7];
// make ascending list
List<int> x = (b, a) => a.compareTo(b);
// install package matrix 2d dart package link : //https://pub.dev/packages/matrix2d
list = X.reshape(3,3);