advanced_chess_board 3.1.0
advanced_chess_board: ^3.1.0 copied to clipboard
A modern looking chess board with advanced features like highlighting the move possibilities, drag-drop pieces, draw arrows etc.
3.1.0 — 2026-05-02 #
Additions #
BoardThemevalue type bundling every paintable colour, withBoardTheme.classicGreen(default),.brown,.blue,.purple,.monochromepresets and acopyWith. Pass via the newAdvancedChessBoard(boardTheme: ...)parameter. LegacylightSquareColor/darkSquareColor/kingBackgroundColorOnCheckmatecontinue to work and take precedence when explicitly passed.PieceSetabstraction with a singleimageFor(PlayerColor, chess.PieceType)lookup and aPieceSet.fromAssetMap(...)convenience factory. DefaultPieceSet.chessDotComwraps the bundled pieces. Pass via the newAdvancedChessBoard(pieceSet: ...)parameter.CoordinateLabelsenum withinside(default, 3.0.0 behaviour),outside(labels in gutters outside the 8×8 playing grid), andnone(no labels, no gutter). Pass via the newAdvancedChessBoard(coordinates: ...)parameter. TheAspectRatio(1)contract still applies to the playing grid in every mode.SoundEvent/SoundPackinterface andSilentSoundPackdefault for move audio. Priority-ordered classification:gameEnd > promote > castle > check > capture > move. No bundled audio, no plugin dependency added — consumers plug in their own backend (e.g.package:audioplayers). Pass via the newAdvancedChessBoard(soundPack: ...)parameter.HintArrowvalue type for engine / hint-API suggestion arrows, rendered with a dashed shaft and stroke-only outlined arrowhead in the newBoardTheme.hintArrowColor. Auto-dismisses on the next successful move, or after an optionalDuration. Pass via the newAdvancedChessBoard(hintArrow: ...)parameter.- Live legality indicator during drag: a drag-legal ring appears on
legal-destination squares currently under the pointer; a drag-illegal
tint appears on non-source non-legal squares. Gated off when
enableMoves: false.
Polish #
HighlightOverlaycolour now threads throughBoardTheme.legalDestinationColor— the default remains pixel-identical to 3.0.0.AdvancedChessBoardnow re-precaches the activePieceSet's 12ImageProviders ondidUpdateWidgetwhenpieceSetchanges.- New
BoardTheme.kingCheckColor(defaultnull— no tint, matches 3.0.0) makes in-check highlighting themable without a breaking change.
3.0.0 — 2026-04-19 #
Breaking changes #
ChessBoardController.isCheckmate()is now a getter. Migrate call sites fromcontroller.isCheckmate()tocontroller.isCheckmate.- Implementation files moved under
lib/src/. Importing from deep paths (e.g.package:advanced_chess_board/chess_board_controller.dart) no longer works. Use the single top-level importpackage:advanced_chess_board/advanced_chess_board.dart, which now re-exportsAdvancedChessBoard,ChessBoardController,ChessArrow, andPlayerColor.
Fixes #
ChessBoardControllernow correctly supports multiple listeners (previously only the most recently registered callback fired).ArrowPainter.shouldRepaintno longer suppresses repaints when the arrow list or board orientation changes.- Destination-square highlighting uses the
chessengine's verbose moves and no longer mis-identifies squares whose name is a substring of a SAN token. disposeordering in the controller follows theChangeNotifiercontract.
Additions #
- Controller getters:
isInCheck,isStalemate,isDraw,isGameOver,history,pgn,moveCount. - Automatic widget rebuild on controller notifications; no need for the
consumer to call
controller.addListener(setState). - Move animations on tap and programmatic moves (configurable via
moveAnimationDuration). Semanticswrappers on squares and pieces for screen-reader support.
Polish #
- Dead-code returns removed; strict-casts / strict-inference / strict-raw-types enabled and all public members carry dartdoc.
- Promotion dialog piece size follows the current board square size.
- Drag feedback is clamped on narrow screens.
- File/rank labels have a minimum font size floor.
- Board layout uses
ColumnofRows — no scrollable viewport. - Piece images are
precacheImage'd on the firstdidChangeDependencies.
2.3.0 — 2025-03-11 #
- Chess piece is scaled while dragging.
- Checkmated king is highlighted with customisable colour (default red).
2.2.0 — 2025-01-28 #
- Added parameter to call controller methods without notifying listeners.
2.1.1 — 2024-12-15 #
- Changed colours of file and rank text to inverted colours of squares.
2.1.0 — 2024-11-02 #
- Squares related to last-played move are highlighted by default.
2.0.0 — 2024-10-10 #
- Breaking:
playerToMoverenamed toplayerColoronChessBoardController. The same rename applies to theboardOrientationvalues onAdvancedChessBoard. Migrate by replacing everyplayerToMoveread on the controller withplayerColor, and everyPlayerToMove.white/blackenum reference used as aboardOrientationwithPlayerColor.white/black. - Added arrows (
arrows:parameter onAdvancedChessBoard).
1.2.1 — 2024-08-20 #
- Renamed
playerToMovetoplayerColor(see 2.0.0 for migration).
1.2.0 — 2024-07-30 #
- Added
playerToMoveon the controller.
1.1.1 — 2024-06-15 #
- Minor layout fixes.
1.1.0 — 2024-05-22 #
- Fixed listener not firing on moves.
1.0.3 — 2024-04-08 #
- Updated
flutter_lintsto^5.0.0.
1.0.2 — 2024-03-12 #
- Added
enableMovesparameter.
1.0.1 — 2024-02-28 #
- Removed unused
chess_vectors_flutterdependency.
1.0.0 — 2024-02-10 #
- Initial release of advanced_chess_board.