arrays - 在 flutter/Dart 中创建二维数组

标签 arrays multidimensional-array flutter dart flutter-layout

我是 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/

相关文章:

C语言错误输出...使用二维数组的pascal三角形

flutter - FFmpeg 音频 concat/join 在 flutter 中无法正常工作

dictionary - 具有多个键的 Flutter dart Map 具有相同的值

C - 无法在我的程序中启动堆栈

java - 创建新的 int[] 数组或使用循环将每个索引设置为 0? java

javascript - 函数附加的全局数组在其他地方显示为零长度

java - 序列化对象文件输出为空

php - 将多维数组插入mysql

php - 关于php中按时间排序数组的问题

firebase - 是 Firebase 音乐流应用程序的理想选择。 ( flutter )