removeConstraints method

Result removeConstraints(
  1. List<Constraint> constraints
)

Attempts to remove a list of constraints from the solver. Either all constraints are removed or none. If more fine-grained control over the removal is required (for example, not failing on removal of constraints not already present in the solver), try removing the each Constraint individually and check the result on each attempt.

Check the Result returned to make sure the operation succeeded. Any errors will be reported via the message property on the Result.

Possible Results:

  • Result.success: The constraints were successfully removed from the solver.
  • Result.unknownConstraint: One or more constraints in the list were not in the solver. So there was nothing to remove.

Implementation

Result removeConstraints(List<Constraint> constraints) {
  Result applier(c) => removeConstraint(c);
  Result undoer(c) => addConstraint(c);

  return _bulkEdit(constraints, applier, undoer);
}