remove method Null safety

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

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? E) {
  // Stop listening to child
  if (_propagateNotification &&
      E != null &&
      E is ChangeNotifier &&
      _values.contains(E)) E.removeListener(_propagate);

  bool result = _values.remove(E);
  if (result) notifyListeners();

  return result;
}