getBoards method Null safety

Future<List> getBoards(
  1. int hints,
  2. int count
)

Implementation

Future<List<dynamic>> getBoards(int hints, int count) async {
  if (hints >= 17 && hints <= 81) {
    var problems = await dartdoku.getProblems(hints, count);
    var boards = [];
    for (SudokuProblem problem in problems) {
      boards.add({
        "initial board":
            SudokuProblem.boardToString(problem.getInitialState()),
        "final board": SudokuProblem.boardToString(problem.getFinalState())
      });
    }
    return boards;
  } else {
    throw Error();
  }
}