getHistoryVerbose method Null safety

List<Map> getHistoryVerbose()

Get current history of game with details in each move

Implementation

List<Map> getHistoryVerbose() {
  List<Move> reversedHistory = [];
  List<Map> moveHistory = [];

  while (history.length > 0) {
    reversedHistory.add(undoMove()!);
  }

  while (reversedHistory.length > 0) {
    Move move = reversedHistory.removeLast();
    moveHistory.add(makePretty(move));
    makeMove(move);
  }
  return moveHistory;
}