removeAll method

  1. @mustCallSuper
void removeAll(
  1. V value
)

Removes all occurrences of the specified value from this ordered list.

This creates a new unmodifiable list without the specified value, preserving the order of remaining items.

@ai This operation has O(n) time complexity due to filtering and list creation.

Implementation

@mustCallSuper
void removeAll(final V value) =>
    _items = [..._items].where((final v) => v != value).toList().unmodifiable;