Puzzle class

Sudoku Puzzle Class Handles:

  • Puzzle options
  • Generation
  • Observable grid change
  • Stopwatch

Constructors

Puzzle(PuzzleOptions options)
Constructs a new Sudoku puzzle - don't forget to run generate
Puzzle.fromMap(Map<String, dynamic> map)
Serialization
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isStopwatchRunning bool
to check stopwatch is paused or not
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

board() Grid?
dispose() → void
Terminate listeners, and prepare Puzzle for closure
fillCell(Position position, int value) List<CellViolation>
Fill a particular Cell at position with value, and returns a list of CellViolation For what violations are, please refer to CellViolation enum
generate() Future<bool>
Generates a new puzzle using parameters set in _options
getTimeElapsed() Duration
Add the time elapsed in case the game is being reloaded from map/storage
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onBoardChange(dynamic handler(Cell)) → void
Set a handler function, which will be called whenever the grid changes. A change is whenever a cell experiences a change in value.
options() PuzzleOptions?
solvedBoard() Grid?
startStopwatch() → void
Getters and setters I can only make these comments so interesting and no more :l
stopStopwatch() → void
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited