addAll method

Future<void> addAll(
  1. Iterable<T> values
)

Add all values to the set. If the set was modified, it is persisted immediately. If values is empty or all values are already present, no write occurs. This method is more efficient than calling add repeatedly.

Implementation

Future<void> addAll(Iterable<T> values) async {
  final before = _mem.length;
  _mem.addAll(values);
  if (_mem.length != before) await _persist();
}