onReachingPromotionRank property

Future<bool> Function(Position position)? onReachingPromotionRank
final

Callback when game is over. If null and showDialogs is true and context is provided, _defaultGameOverDialog is shown. _defaultPromotionDialog is shown if this field is null and showDialogs is true. Callback is made when a pawn reaches the promotion rank. Use ChessBoardInterface.promotePawn(Position, PieceType) to promote the pawn and must return the promotion status either true or false.

Implementation

// final Function(GameOverBy)? onGameOver;

/// _defaultPromotionDialog is shown if this field is null and [showDialogs] is true. Callback is made when a pawn reaches the promotion rank. Use [ChessBoardInterface].promotePawn([Position], [PieceType]) to promote the pawn and must return the promotion status either true or false.
final Future<bool> Function(Position position)? onReachingPromotionRank;