setSquareState method Null safety

void setSquareState(
  1. {Piece? newState}
)

Implementation

void setSquareState({Piece? newState}) {
  value = value.copyWith(squareState: newState);
  notifyListeners();
}