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) {
final legalMove = context
.read<ChessBloc>()
.preCheckHandler(PreCheckMove(move: move!));
move!.endSquare = coordinate;
final legalMove =
context.read<ChessBloc>().preCheckHandler(PreCheckMove(move: move));
print('onWillAccept returns $legalMove');
return legalMove;
},