From 6f124b9a5fe4766f716686b8ce5455fb2dc627d3 Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 19 Nov 2022 11:46:44 +0100 Subject: [PATCH] Fix bug in onWillAccept. Set endSquare correctly. --- lib/chessapp/chess_square.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/chessapp/chess_square.dart b/lib/chessapp/chess_square.dart index fba0634..8575ee6 100644 --- a/lib/chessapp/chess_square.dart +++ b/lib/chessapp/chess_square.dart @@ -83,9 +83,9 @@ class ChessSquare extends StatelessWidget { ); }, onWillAccept: (move) { - final legalMove = context - .read() - .preCheckHandler(PreCheckMove(move: move!)); + move!.endSquare = coordinate; + final legalMove = + context.read().preCheckHandler(PreCheckMove(move: move)); print('onWillAccept returns $legalMove'); return legalMove; },