smartAdd method

bool smartAdd(
  1. T value
)

Adds the given value to the set and notifies listeners if the value was added.

  • value: The element to add to the set.
  • Returns: true if the value was added, false otherwise.

Implementation

bool smartAdd(T value) {
  final added = this.value.add(value);
  if (added) {
    notify();
  }
  return added;
}