makeSanMove method Null safety

bool makeSanMove(
  1. String move
)

returns true if successfully make the move otherwise false

Implementation

bool makeSanMove(String move) {
  chessjs.Move? moveObj;
  final moves = _logic.generateMoves();
  for (int i = 0; i < moves.length; i++) {
    if (move == _logic.moveToSan(moves[i])) {
      moveObj = moves[i];
      break;
    }
  }
  if (moveObj != null) {
    _makeMove(moveObj);
    _updateBoardAfterMove(moveObj);
    refreshBoard();
    return true;
  } else {
    return false;
  }
}