listenAllLevelButtons method

void listenAllLevelButtons (int reachedLevel)

Listens for all the 'level buttons' click events, sets the new _activeLevel accordingly and shows the 'levelOverview'.

Implementation

void listenAllLevelButtons(int reachedLevel) {
  for (int i = 0; i < this.getReachedLevel(); i++) {
    querySelector("#level-${i + 1}").onClick.listen((Event e) {
      e.preventDefault();
      this.setActiveLevel(i + 1);
      this.showLevelOverview();
    });
  }
}