list - 我如何获得“列表”的特定范围>>”?
问题描述
我想编写一个数独应用程序,我在地图列表中有一个列表来突出显示和显示游戏区域中的整数。
我的列表如下所示:
List<List<Map<String, dynamic>>> output = [
[
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
],
[
{'integer': '', 'color': Colors.purple},
{'integer': '', 'color': Colors.purple},
...
所以我想改变特定区域的颜色。我尝试了一些 googlin 并想出了这个和一些变体:
selectField(indexBlock, index) {
output[indexBlock][index]['color'] = Colors.white;
output[indexBlock].getRange(0, 8).['color'] = Colors.purpleAccent; // this part with getRange is not working like i want it to
notifyListeners();
}
解决方案
推荐阅读
- javascript - 如何自动提交价格过滤器?
- python - 如何使用枚举完成数组中的数组之间的匹配?
- reactjs - 为什么在 this.state 上使用 useState?
- oracle - 无法显示工资超过 1300 的员工
- javascript - 我想在我的数据表中添加 excel 按钮以进行 excel 导出
- ios - 在 URLSession.shared.dataTask 之后,它要么不返回错误,要么不成功
- javascript - 我应该如何修改我的搜索栏代码以同时影响 2 个表,而不仅仅是 1 个?
- python-3.x - 熊猫,如何使用带有多索引数据框的子集删除值?
- scala - 匹配表达式后,for循环不返回列表中的值
- javascript - 如何使模态窗口的标题固定在顶部