addTags method

Future addTags(
  1. Iterable<T> elements,
  2. Iterable<Object?> tags
)

Add tags to objects in the registry.

Each element of the registry has a number of tags associated with it. A tag is either associated with an element or not, adding it more than once does not make any difference.

Tags are compared using Object.== equality.

Fails if any of the elements are not in the registry.

Implementation

Future addTags(Iterable<T> elements, Iterable<Object?> tags) {
  List<Object?> ids = elements.map(_getId).toList(growable: false);
  return _addTags(ids as List<int>, tags);
}