>>”?,list,flutter,dart,maps,sudoku"/>

首页 > 解决方案 > 我如何获得“列表”的特定范围>>”?

问题描述

我想编写一个数独应用程序,我在地图列表中有一个列表来突出显示和显示游戏区域中的整数。

我的列表如下所示:

  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();
  }

标签: listflutterdartmapssudoku

解决方案


推荐阅读