flutter_chess_board
flutter_chess_board copied to clipboard
_promotionDialog pops up even if there is no promotion
logic, which fires _promotionDialog is incorrect:
if (pieceMoveData.pieceType == "P" &&
((pieceMoveData.squareName[1] == "7" &&
squareName[1] == "8" &&
pieceMoveData.pieceColor == Color.WHITE) ||
(pieceMoveData.squareName[1] == "2" &&
squareName[1] == "1" &&
pieceMoveData.pieceColor == Color.BLACK))) {
var val = await _promotionDialog(context);
It will run _promotionDialog even if
- game is in check state
- pawn is moved to occupied promotion field by the same color