chessground library

Chessboard package developed for lichess.org.

It doesn't handle chess logic so you can use it for any chess variant.

Classes

Annotation
A chess move annotation represented by a symbol and a color.
Arrow
An arrow shape that can be drawn on the board.
Background
Base widget for the background of the chessboard.
Board
A chessboard widget.
BoardColorScheme
Describes the color scheme of a Board.
BoardData
Board data.
BoardSettings
Board settings that control the theme, behavior and purpose of the board.
CheckHighlight
Circle
An circle shape that can be drawn on the board.
Coord
Zero-based numeric board coordinate.
DrawShapeOptions
Highlight
HighlightDetails
Square highlight color or image on the chessboard.
ImageBackground
A chessboard background made of an image.
Move
A chess move.
MoveDest
OccupiedMoveDest
Piece
Describes a chess piece by its role and color.
PieceShape
PieceWidget
Widget that displays a chess piece
PositionedPiece
A piece and its position on the board.
Shape
Base class for shapes that can be drawn on the board.
SolidColorBackground
A chessboard background with solid color squares.

Enums

BoardTheme
The chessboard theme.
InteractableSide
The side that can interact with the board.
PieceKind
Piece kind, such as white pawn, black knight, etc.
PieceSet
The chess piece set that will be displayed on the board.
Role
Piece role, such as pawn, knight, etc.
Side
The chessboard side, white or black.

Constants

files → const List<String>
Files of the chessboard.
ranks → const List<String>
Ranks of the chessboard.

Properties

allCoords List<Coord>
All the coordinates of the chessboard.
final
allSquares List<SquareId>
All the squares of the chessboard.
final

Functions

premovesOf(SquareId square, Pieces pieces, {bool canCastle = false}) Set<SquareId>
Returns the set of squares that the piece on square can potentially premove to.
readFen(String fen) Pieces
Parse the board part of a FEN string.

Typedefs

PieceAssets = IMap<PieceKind, AssetImage>
Describes a set of piece assets.
Pieces = Map<SquareId, Piece>
Representation of the piece positions on a board.
SquareId = String
Square identifier using the algebraic coordinate notation such as e2, c3, etc.
ValidMoves = IMap<SquareId, ISet<SquareId>>
Sets of each valid destinations for an origin square.