add method

void add(
  1. String key,
  2. Iterable<ContextualResource<T, C>> options
)

Adds a resource.

Implementation

void add(String key, Iterable<ContextualResource<T, C>> options) {
  if (isEmptyObject(options)) return;

  var entries =
      _resources.putIfAbsent(key, () => <ContextualResource<T, C>>{});

  var size = entries.length;
  entries.addAll(options);

  if (entries.length != size) {
    _resourcesSorted.remove(key);
  }
}