removeByLabel method

E removeByLabel(
  1. String label
)

Removes the element associated with label from the list.

Implementation

E removeByLabel(String label) {
  assert(hasLabel(label),
      'This list doesn\'t contain an element assocaited with [label].');
  final index = _labels.indexOf(label);
  _labels.removeAt(index);
  return elements.removeAt(index);
}