FicListExtension<T> extension
- on
-
- List<
T>
- List<
Properties
-
lock
→ IList<
T> -
Available on List<
Locks the list, returning an immutable list (T> , provided by the FicListExtension extensionIList).no setter -
lockUnsafe
→ IList<
T> -
Available on List<
Locks the list, returning an immutable list (T> , provided by the FicListExtension extensionIList).no setter -
reversedView
→ List<
T> -
Available on List<
Returns a List of the objects in this list in reverse order. Very efficient since it returns a view (which means, if you change the original list this one will also change, and vice-versa).T> , provided by the FicListExtension extensionno setter
Methods
-
addBetween(
T separator) → List< T> -
Available on List<
Return a new list, adding a separator between the original list items (but not before the first and after the last).T> , provided by the FicListExtension extension -
compareAsSets(
List other) → bool -
Available on List<
ReturnT> , provided by the FicListExtension extensiontrueif the lists contain the same items (in any order). Ignores repeated items. -
concat(
List< T> ? list2, [List<T> ? list3, List<T> ? list4, List<T> ? list5]) → List<T> -
Available on List<
Return an efficient concatenation of up to 5 lists:T> , provided by the FicListExtension extension -
distinct(
{dynamic by(T item)?}) → List< T> -
Available on List<
Returns a new list, which is equal to the original one, but without duplicates. In other words, the new list has only distinct items. Optionally, you can provide anT> , provided by the FicListExtension extensionidfunction to compare the items. -
divideList(
Predicate< T> test) → List<List< T> > -
Available on List<
Search a list for items that satisfy aT> , provided by the FicListExtension extensiontestpredicate (matching items), and then divide that list into parts, such as each part contains one matching item. Except maybe for the first matching item, it will keep the matching items as the first item in each part. -
divideListAsMap<
G> (bool test(T item), {G key(T item)?, bool includeFirstItems = false}) → Map< G, List< T> > -
Available on List<
Search a list for items that satisfy aT> , provided by the FicListExtension extensiontestpredicate (matching items), and then divide that list into a Map of parts, such as each part contains one matching item, and the keys are given by thekeyfunction. -
get(
int index, {T orElse(int index)?}) → T -
Available on List<
Returns theT> , provided by the FicListExtension extensionindexth element. If that index doesn't exist (negative, or out of range), will return the result of callingorElse. In this case, iforElseis not provided, will throw an error. -
getAndMap(
int index, T map(int index, bool inRange, T? value)) → T -
Available on List<
Gets theT> , provided by the FicListExtension extensionindexth element, and then apply themapfunction to it, returning the result. If that index doesn't exist (negative, or out of range), will themapmethod will be called withinRangefalse andvaluenull. -
getOrNull(
int index) → T? -
Available on List<
Returns theT> , provided by the FicListExtension extensionindexth element. If that index doesn't exist (negative or out of range), will return null. This method will never throw an error. -
moveToTheEnd(
T item) → void -
Available on List<
Moves the first occurrence of theT> , provided by the FicListExtension extensionitemto the end of the list. -
moveToTheFront(
T item) → void -
Available on List<
Moves the first occurrence of theT> , provided by the FicListExtension extensionitemto the start of the list. -
removeDuplicates(
{dynamic by(T item)?, bool removeNulls = false}) → void -
Available on List<
Removes all duplicates from the list, leaving only the distinct items. Optionally, you can provide anT> , provided by the FicListExtension extensionidfunction to compare the items. -
removeNulls(
) → void -
Available on List<
Removes allT> , provided by the FicListExtension extensionnulls from the List. -
sortLike(
Iterable ordering) → void -
Available on List<
Sorts this list according to the order specified by theT> , provided by the FicListExtension extensionorderingiterable. Items which don't appear inorderingwill be included in the end, in their original order. Items oforderingwhich are not found in the original list are ignored. -
sortOrdered(
[int compare(T a, T b)?]) → void -
Available on List<
Sorts this list according to the order specified by theT> , provided by the FicListExtension extensioncomparefunction. -
sortReversed(
[int compare(T a, T b)?]) → void -
Available on List<
Sorts this list in reverse order in relation to the default sort method.T> , provided by the FicListExtension extension -
splitByLength(
int length) → List< List< T> > -
Available on List<
Cut the original list into one or more lists with at mostT> , provided by the FicListExtension extensionlengthitems. -
splitList(
bool test(T item), {bool emptyParts = false}) → Iterable< List< T> > -
Available on List<
Split a list, according to a predicate, removing the list item that satisfies the predicate.T> , provided by the FicListExtension extension -
toggle(
T item) → bool -
Available on List<
If the item does not exist in the list, add it and returnT> , provided by the FicListExtension extensiontrue. If it already exists, remove the first instance of it and returnfalse. -
whereMoveToTheEnd(
bool test(T item)) → void -
Available on List<
Moves all items that satisfy the providedT> , provided by the FicListExtension extensiontestto the end of the list. Keeps the relative order of the moved items. -
whereMoveToTheFront(
bool test(T item)) → void -
Available on List<
Moves all items that satisfy the providedT> , provided by the FicListExtension extensiontestto the start of the list. Keeps the relative order of the moved items.