removeFirstOccurrence method

ImmortalList<T> removeFirstOccurrence(
  1. Object? element
)

Returns a copy of this list where the first occurrence of element is removed from if present.

If element is not present in the list, the list is returned unchanged.

Use remove to remove all occurrences of a value.

Implementation

ImmortalList<T> removeFirstOccurrence(Object? element) =>
    _mutateAsListIf(contains(element), (list) => list..remove(element));