Puzzle.fromMap constructor
Serialization
Implementation
factory Puzzle.fromMap(Map<String, dynamic> map) {
if (!map.containsKey('board') ||
!map.containsKey('options') ||
!map.containsKey('solved_board')) {
throw ('Missing board or options in the map');
}
return Puzzle._(
board: Grid.fromMap(map['board']),
solvedBoard: Grid.fromMap(map['solved_board']),
options: PuzzleOptions.fromMap(map['options']),
timeElapsedInSeconds: map['time_elapsed_in_seconds']);
}