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
-
- List<
T>
- List<
Methods
-
addAllIfNotExists(
List< T> newitemList, {EqualityChecker<T> ? equalityChecker}) → void -
Available on List<
Adds all the items from theT> , provided by the ListUtilExtensions extensionnewitemListto the current list of items, if they do not already exist. -
insertIfNotExists(
T item, {int? index, EqualityChecker< T> ? equalityChecker}) → bool -
Available on List<
Inserts theT> , provided by the ListUtilExtensions extensionitemat the givenindexif it does not already exist. -
removeIfExist(
T item, {EqualityChecker< T> ? equalityChecker}) → bool -
Available on List<
Removes the givenT> , provided by the ListUtilExtensions extensionitemif it exists in the list.