ChessboardController class

Inheritance

Constructors

ChessboardController({MoveCallback? onMove, CheckMateCallback? onCheckMate, CheckCallback? onCheck, DrawCallback? onDraw, bool enablePlay = true, Chess? chessjsGame})

Properties

enablePlay bool
User moves can be enabled or disabled by this property
getter/setter pair
gameLogic ↔ Chess
Creates a logical chess game
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
onCheck CheckCallback?
Callback for when a player is in check
getter/setter pair
onCheckMate CheckMateCallback?
Callback for when a player is checkmated
getter/setter pair
onDraw DrawCallback?
Callback for when the game is a draw (Example: K v K)
getter/setter pair
onMove MoveCallback?
Callback for when a move is made
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
disableUserMoves() → void
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
enableUserMove() → void
getSanHistory() List<String>
TODO make select a move possible in the notation Implement how to iterate over lines. Also create functions to display in the board the state after selecting a move from notation. The PROBLEM -> we are displaying the state of the board based on the last state of the history. In the buildBoard function the controller is passed to each BoardSquare and the board variable of gameLogic tells whether a piece in on the square Get history of game (moves) in SAN format Returns a List
getVerboseHistory() List<Map>
Get history of game (moves) with details for each move. Returns a List
makeMove(String move) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
refreshBoard() → void
Refreshes board
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited

Operators

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