ListUtilExtensions<T> extension

Extension methods for List to provide utility functions such as inserting items if they do not exist, adding items from another list if they do not exist, and removing items if they exist.

on

Methods

addAllIfNotExists(List<T> newitemList, {EqualityChecker<T>? equalityChecker}) → void

Available on List<T>, provided by the ListUtilExtensions extension

Adds all the items from the newitemList to the current list of items, if they do not already exist.
insertIfNotExists(T item, {int? index, EqualityChecker<T>? equalityChecker}) bool

Available on List<T>, provided by the ListUtilExtensions extension

Inserts the item at the given index if it does not already exist.
removeIfExist(T item, {EqualityChecker<T>? equalityChecker}) bool

Available on List<T>, provided by the ListUtilExtensions extension

Removes the given item if it exists in the list.