remove method Null safety

bool remove(
  1. Object? object

Removes value from the set.

Returns true if value was in the set, and false if not. The method has no effect if value was not in the set.


bool remove(Object? object) {
  if (!_validKey(object)) return false;
  return _remove(object as E) != null;