ChessboardController class Null safety

Constructors

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

Properties

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

Methods

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. [...]
inherited
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. [...]
inherited
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.

Operators

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