pause method

void pause()

Pauses gravity, lock delay and the play clock.

Implementation

void pause() {
  if (_state.status != TetrisGameStatus.playing) return;
  _record('pause');
  _gravityTimer?.cancel();
  _lockTimer?.cancel();
  _playClock.stop();
  _state = _state.copyWith(status: TetrisGameStatus.paused);
  _emit(const TetrisEvent(TetrisEventType.paused));
  notifyListeners();
}