我是 flutter 和 Dart 的新手。我搜索过谷歌,我能找到的只是如何在 flutter 中制作一维列表。我需要一个值图表。
具体来说,我需要一行 12 长和一列 31 长填充升序数字
1, 32, 63,
2, 33, 64,
3, 34, 65, etc....
谢谢!
最佳答案
int row = 3;
int col = 4;
var twoDList = List.generate(row, (i) => List(col), growable: false);
//For fill;
twoDList[0][1] = "deneme";
print(twoDList);
// [[null, deneme, null, null], [null, null, null, null], [null, null, null, null]]
您的 2D 列表有 3 行和 4 列。
关于arrays - 在 flutter/Dart 中创建二维数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57860596/