Our app isn't playable yet:
Note
For the code file for this section, refer to Chapter 7\code\educ_memory_game\spirals\s05
in the code bundle.
All of this is coded in the mouseDown
event handler and we also need a lastCellClicked
variable of the Cell
type in the Board
class. Of course, this is exactly the cell we get in the mouseDown
event handler. So, we will set it 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...