ChessboardController class


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


board ChessboardModel
no setter
hashCode int
The hash code for this object.
no setterinherited
logic → Chess
no setter
moveHistoryNotifier MoveHistoryNotifier
no setter
onCheck CheckCallback?
getter/setter pair
onCheckMate CheckMateCallback?
getter/setter pair
onDraw DrawCallback?
getter/setter pair
onMove MoveCallback?
getter/setter pair
onOfferDraw OfferDrawCallback?
getter/setter pair
onResign ResignCallback?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


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 nonexistent 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.