Our app isn't playable yet:
Note
For code file for this section, refer to chapter 7\educ_memory_game\spirals\s05
in the code bundle.
All of this is coded in the mouseDown
event handler, and we also need a variable lastCellClicked
of type Cell
in the Board
class. Of course, this is exactly the cell which we get in the
mouseDown
event handler. So, we set this in line (5)
in the following code snippet:
void onMouseDown(MouseEvent e) { // same code as in Spiral 4 - if (cell.twin == lastCellClicked && lastCellClicked.shown) { (1) lastCellClicked.hidden = false; (2) if (memory.recalled) memory.hide(); (3) } else { new Timer(const Duration(milliseconds: 1000), () => cell.hidden...