ChessboardController class Null safety


ChessboardController({MoveCallback? onMove, DrawCallback? onDraw, CheckCallback? onCheck, CheckMateCallback? onCheckMate, ResignCallback? onResign, OfferDrawCallback? onOfferDraw, String? startingPosition})


board ChessboardModel
hashCode int
The hash code for this object. [...]
read-only, inherited
logic Chess
moveHistoryNotifier MoveHistoryNotifier
onCheck CheckCallback?
read / write
onCheckMate CheckMateCallback?
read / write
onDraw DrawCallback?
read / write
onMove MoveCallback?
read / write
onOfferDraw OfferDrawCallback?
read / write
onResign ResignCallback?
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


buildBoard() → void
build the board according to the logic state
flipBoard() → dynamic
getSanHistory() List<String>
get history of moves from logic
getSquareNotifier(String squareName) SquareNotifier
getVerboseHistory() List<Map>
Get history of game (moves) with details for each move. Returns a List
makeMoveWithoutCallback(String move) bool
make move without calling the controller callbacks. Others make move methods, call refreshBoard at the end, triggering callbacks
makePrettyMove(Map<String, String> move) bool
Attempt to make a move in the board if successfully made the move, return true and update the respective squares, otherwise return false.
makeSanMove(String move) bool
returns true if successfully make the move otherwise false
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
refreshBoard() → void
use refreshBoard to force controller callbacks to run, for example onMove, onCheck...
setPlayerMode(PlayerMode mode) → dynamic
toggleMovesEnabled() → dynamic
toString() String
A string representation of this object. [...]
undoMove() → void
undo a logical move and updates the board
updateSquare(String squareName) → dynamic
update state of a specific square provided its squareName and the state from the logic.


operator ==(Object other) bool
The equality operator. [...]