generateShape method

void generateShape()

It generates a list of rows, each row containing a list of buttons

Implementation

void generateShape() {
  for (int i = 0; i < 6; i++) {
    final List<Widget> rowChildren = <Widget>[];
    for (int j = 0; j < 6; j++) {
      if (validatePosition(i, j)) {
        rowChildren.add(
          CrossButton(
            shakeKey: widget.shakeKey,
            shakeKeyColors: widget.shakeKeyColors,
            globalKey: GlobalKey<CrossButtonState>(),
            position: Pair<int, int>(i, j),
            selectionMode: widget.selectionMode,
            coloredButtons: widget.coloredButtons,
            selectedButtons: widget.selectedButtons,
            buttons: buttons,
            resultValueNotifier: widget.resultValueNotifier,
          ),
        );
      } else {
        rowChildren.add(
          const DummyButton(),
        );
      }
    }
    buttons.add(
      Row(
        children: rowChildren,
      ),
    );
  }
}