remove method

bool remove(
  1. T item
)

Removes item from the set.

Returns true if the item was present and removed.

Behavior:

  • If the item does not exist, no update is triggered
  • If removed successfully, a new Set instance is created
  • Reactive listeners are notified via state update

Implementation

bool remove(T item) {
  final newSet = Set<T>.of(value);

  final removed = newSet.remove(item);

  if (removed) {
    value = newSet;
  }

  return removed;
}