canMove method
True if the piece can move one cell in the given direction.
Implementation
bool canMove(Tetromino piece, BoardState board, int dRow, int dCol) {
final moved = piece.copyWith(
position: Position(piece.position.row + dRow, piece.position.col + dCol),
);
return !hasCollision(moved, board);
}