Fix bug in onWillAccept. Set endSquare correctly.

This commit is contained in:
Marco 2022-11-19 11:46:44 +01:00
parent 42e90f10a6
commit 6f124b9a5f

View File

@ -83,9 +83,9 @@ class ChessSquare extends StatelessWidget {
); );
}, },
onWillAccept: (move) { onWillAccept: (move) {
final legalMove = context move!.endSquare = coordinate;
.read<ChessBloc>() final legalMove =
.preCheckHandler(PreCheckMove(move: move!)); context.read<ChessBloc>().preCheckHandler(PreCheckMove(move: move));
print('onWillAccept returns $legalMove'); print('onWillAccept returns $legalMove');
return legalMove; return legalMove;
}, },