remove method Null safety

  1. @override
bool remove(
  1. Object? element
)
override

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.

Implementation

@override
bool remove(Object? element) {
  if (element is! V) return false;
  var key = _keyForValue(element);

  if (!_baseMap.containsKey(key)) return false;
  _baseMap.remove(key);
  return true;
}