IList<T> class abstract

An immutable list. Note: The replace method is the equivalent of operator []= for the IList.

Inheritance
Implemented types
Available extensions
Annotations
  • @immutable

Constructors

IList.new([Iterable<T>? iterable])
Create an IList from an iterable, with the default configuration. Fast, if the iterable is another IList.
factory
IList.fromISet(ISet<T> iset, {int compare(T a, T b)?, required ConfigList? config})
Special IList constructor from ISet.
factory
IList.fromJson(dynamic json, T fromJsonT(Object?))
Converts from JSon. Json serialization support for json_serializable with @JsonSerializable.
factory
IList.unsafe(List<T> list, {required ConfigList config})
Unsafe constructor. Use this at your own peril.
factory
IList.withConfig(Iterable<T>? iterable, ConfigList config)
Create an IList from any Iterable and a ConfigList. Fast, if the Iterable is another IList. If iterable is null, return an empty IList.
factory

Properties

asComparableEntries Iterable<Entry<K, V>>

Available on Iterable<MapEntry<K, V>>, provided by the FicIterableOfMapEntryExtension extension

MapEntry is not Comparable. If you need to compare two iterables of MapEntry you can do this:
no setter
collect ZIO<R, E, IList<A>>

Available on Iterable<IZIO<R, E, A>>, provided by the ZIOIterableExt extension

Alias for ZIO.collect
no setter
collectDiscard ZIO<R, E, Unit>

Available on Iterable<IZIO<R, E, A>>, provided by the ZIOIterableExt extension

Alias for ZIO.collectDiscard
no setter
collectPar ZIO<R, E, IList<A>>

Available on Iterable<IZIO<R, E, A>>, provided by the ZIOIterableExt extension

Alias for ZIO.collectPar
no setter
collectParDiscard ZIO<R, E, Unit>

Available on Iterable<IZIO<R, E, A>>, provided by the ZIOIterableExt extension

Alias for ZIO.collectParDiscard
no setter
config ConfigList
no setter
first → T
Returns the first element. Throws a StateError if the list is empty.
no setteroverride
firstOption Option<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Get the first element of the Iterable. If the Iterable is empty, return None.
no setter
firstOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The first element of this iterator, or null if the iterable is empty.
no setter
firstOrNull → T?
Returns the first element, or null if the list is empty.
no setter
flatten Iterable<T>

Available on Iterable<Iterable<T>>, provided by the ElementalOnIterableOfIterable extension

From a Iterable<Iterable<T>> return a Iterable<T> of their concatenation.
no setter
flush IList<T>
Flushes the list, if necessary. Chainable getter. If the list is already flushed, don't do anything.
no setteroverride
hashCode int
The hash code for this object.
no setteroverride
Returns the first element of this Iterable
no setter

Available on Iterable<T>, provided by the ElementalOnIterable extension

Get the first element of the Iterable. If the Iterable is empty, return None.
no setter
indexed Iterable<(int, T)>

Available on Iterable<T>, provided by the IterableExtensions extension

Pairs of elements of the indices and elements of this iterable.
no setter
init Iterable<T>
Returns an Iterable that is the original iterable without the last element
no setter
init Option<Iterable<T>>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return all the elements of a Iterable except the last one. If the Iterable is empty, return None.
no setter
isDeepEquals bool
See also: ConfigList
no setter
isEmpty bool
Returns true if there are no elements in this collection.
no setteroverride
isFlushed bool
Whether this list is already flushed or not.
no setteroverride
isIdentityEquals bool
See also: ConfigList
no setter
isNotEmpty bool
Returns true if there is at least one element in this collection.
no setteroverride
iterator Iterator<T>
Returns a new Iterator that allows iterating the elements of this IList.
no setteroverride
last → T
Returns the last element. Throws a StateError if the list is empty.
no setteroverride
lastOption Option<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Get the last element of the Iterable. If the Iterable is empty, return None.
no setter
lastOrNull → T?
Returns the last element, or null if the list is empty.
no setter
lastOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The last element of this iterable, or null if the iterable is empty.
no setter
length int
The number of objects in this list.
no setteroverride
nonNulls Iterable<T>

Available on Iterable<T?>, provided by the NullableIterableExtensions extension

The non-null elements of this iterable.
no setter
raceAll ZIO<R, E, A>

Available on Iterable<IZIO<R, E, A>>, provided by the ZIOIterableExt extension

Alias for ZIO.raceAll
no setter
reversed IList<T>
Returns an Iterable of the objects in this list in reverse order.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single → T
Checks that this iterable has only one element, and returns that element. Throws a StateError if the list is empty or has more than one element.
no setteroverride
singleOrNull → T?
Checks that the list has only one element, and returns that element. Return null if the list is empty or has more than one element.
no setter
singleOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The single element of this iterator, or null.
no setter
tail Option<Iterable<T>>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return all the elements of a Iterable except the first one. If the Iterable is empty, return None.
no setter
tail Iterable<T>
Returns an Iterable that is the original iterable without head, aka first element
no setter
unlock List<T>
Unlocks the list, returning a regular (mutable, growable) List. This list is "safe", in the sense that is independent from the original IList.
no setter
unlockLazy List<T>
Unlocks the list, returning a safe, modifiable (mutable) List. Using this is very fast at first, since it makes no copies of the IList items. However, if and only if you use a method that mutates the list, like add, it will unlock internally (make a copy of all IList items). This is transparent to you, and will happen at most only once. In other words, it will unlock the IList, lazily, only if necessary. If you never mutate the list, it will be very fast to lock this list back into an IList.
no setter
unlockView List<T>
Unlocks the list, returning a safe, unmodifiable (immutable) List view. The word "view" means the list is backed by the original IList. Using this is very fast, since it makes no copies of the IList items. However, if you try to use methods that modify the list, like add, it will throw an UnsupportedError. It is also very fast to lock this list back into an IList.
no setter
wait Future<List<T>>

Available on Iterable<Future<T>>, provided by the FutureIterable extension

Waits for futures in parallel.
no setter
withDeepEquals IList<T>
Creates a list with deepEquals (compares all list items by equality).
no setter
withIdentityEquals IList<T>
Creates a list with identityEquals (compares the internals by identity).
no setter

Methods

add(T item) IList<T>
Return a new list with item added to the end of the current list, (thus extending the length by one).
addAll(Iterable<T> items) IList<T>
Returns a new list with all items added to the end of the current list, (thus extending the length by the length of items).
all(bool test(T t)) bool

Available on Iterable<T>, provided by the ElementalOnIterable extension

Checks whether every element of this Iterable satisfies test.
any(Predicate<T> test) bool
Checks whether any element of this iterable satisfies test.
override
anyIs(T value) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns true if any item is equal to value.
ap<B>(Iterable<B Function(T)> iterable) Iterable<B>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Apply all the functions inside iterable to this Iterable.
append(T element) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert element at the end of the Iterable.
asList() List<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns a List containing the elements of this iterable. If the Iterable is already a List, return the same instance (nothing new is created). Otherwise, create a new List from it. See also: Dart's native toList, which always creates a new list.
asMap() IMap<int, T>
Returns an IMap view of this list. The map uses the indices of this list as keys and the corresponding objects as values. The Map.keys Iterable iterates the indices of this list in numerical order.
asNameMap() Map<String, T>

Available on Iterable<T>, provided by the EnumByName extension

Creates a map from the names of enum values to the values.
asSet() Set<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Creates a Set containing the same elements as this iterable. If the Iterable is already a Set, return the same instance (nothing new is created). Otherwise, create a new Set from it. See also: Dart's native toSet, which always creates a new set.
averageBy<N extends num>(N mapper(T element)) double

Available on Iterable<T>, provided by the FicIterableExtension extension

The arithmetic mean of the elements of a non-empty iterable. The arithmetic mean is the sum of the elements divided by the number of elements. If iterable is empty it returns 0. Examples:
breakI(bool test(T t)) → (Iterable<T>, Iterable<T>)

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that do not satisfy test and second element is the remainder of the Iterable.
byName(String name) → T

Available on Iterable<T>, provided by the EnumByName extension

Finds the enum value in this list with name name.
cast<R>() Iterable<R>
Returns a list of R instances. If this list contains instances which cannot be cast to R, it will throw an error.
override
clear() IList<T>
Returns an empty list with the same configuration.
concat(Iterable<T> other) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Creates the lazy concatenation of this Iterable and other.
contains(covariant T? element) bool
Returns true if the collection contains an element equal to element, false otherwise.
override
corresponds<U>(Iterable<U> others, EQ eq) bool
Return true if length match and all Eq are true.
count(Predicate<T> p) int
Positives predicate results count
deepEquals(Iterable? other, {bool ignoreOrder = false}) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Compare all items, in order or not, according to ignoreOrder, using operator ==. Return true if they are all the same, in the same order.
deepEqualsByIdentity(Iterable? other, {bool ignoreOrder = false}) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if they are all the same, in the same order. Compare all items, in order or not, according to ignoreOrder, using identical. Return true if they are all the same, in the same order.
delete(T element) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Remove the first occurrence of element from this Iterable.
divideIn2(bool test(T item)) IListOf2<IList<T>>
Divides the list into two. The first one contains all items which satisfy the provided test. The last one contains all the other items. The relative order of the items will be maintained.
drop(int n) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return the suffix of this Iterable after the first n elements.
dropRight([int count = 1]) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Drops the last count element of this iterable.
dropWhileLeft(bool test(T t)) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Remove all elements starting from the first as long as test returns true.
elem(T element) bool

Available on Iterable<T>, provided by the ElementalOnIterable extension

Check if element is contained inside this Iterable.
elementAt(int index) → T
Returns the indexth element. This is the same as using the [] operator. See also: get and getOrNull.
override
elementAtOrNull(int index) → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The element at position index of this iterable, or null.
equalItems(covariant Iterable? other) bool
Will return true only if the IList items are equal to the iterable items, and in the same order. This may be slow for very large lists, since it compares each item, one by one. You can compare the list with ordered sets, but unordered sets will throw a StateError. To compare the IList with unordered sets, try the unorderedEqualItems method.
override
equalItemsAndConfig(IList? other) bool
Will return true only if the list items are equal and in the same order, and the list configurations are equal. This may be slow for very large lists, since it compares each item, one by one.
override
every(Predicate<T> test) bool
Checks whether every element of this iterable satisfies test.
override
everyIs(T value) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns true if all items are equal to value.
expand<E>(Iterable<E> f(T)) Iterable<E>
Expands each element of this Iterable into zero or more elements.
override
fillRange(int start, int end, [T? fillValue]) IList<T>
Sets the objects in the range start inclusive to end exclusive to the given fillValue.
filter(bool test(T t)) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Returns the list of those elements that satisfy test.
filterWithIndex(bool test(T t, int index)) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Returns the list of those elements that satisfy test.
findDuplicates() Set<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Finds duplicates and then returns a Set with the duplicated elements. If there are no duplicates, an empty Set is returned.
firstOr(T orElse) → T
Returns the first element, or orElse if the list is empty.
firstWhere(Predicate<T> test, {T orElse()?}) → T
Iterates through elements and returns the first to satisfy test.
override
flatMap<B>(Iterable<B> toElements(T t)) Iterable<B>

Available on Iterable<T>, provided by the ElementalOnIterable extension

For each element of the Iterable apply function toElements and flat the result.
flatMapWithIndex<B>(Iterable<B> toElements(T t, int index)) Iterable<B>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Same as flatMap (extend) but provides also the index of each mapped element in the mapping function (toElements).
fold<E>(E initialValue, E combine(E previousValue, T element)) → E
Reduces a collection to a single value by iteratively combining eac element of the collection with an existing value.
override
foldLeft<B>(B initialValue, B combine(B b, T t)) → B

Available on Iterable<T>, provided by the ElementalOnIterable extension

Fold this Iterable into a single value by aggregating each element of the list from the first to the last.
foldLeftWithIndex<B>(B initialValue, B combine(B previousValue, T element, int index)) → B

Available on Iterable<T>, provided by the ElementalOnIterable extension

Same as foldLeft (fold) but provides also the index of each mapped element in the combine function.
followedBy(Iterable<T> other) Iterable<T>
Returns the lazy concatenation of this iterable and other.
override
forEach(void f(T element)) → void
Applies the function f to each element of this collection in iteration order.
override
get(int index, {T orElse(int index)?}) → T
Returns the indexth element. If that index doesn't exist (negative, or out of range), will return the result of calling orElse. In this case, if orElse is not provided, will throw an error.
getAndMap(int index, T map(int index, bool inRange, T? value)) → T
Gets the indexth element, and then apply the map function to it, returning the result. If that index doesn't exist (negative, or out of range), will the map method will be called with inRange false and value null.
getOrNull(int index) → T?
Returns the indexth element. If that index doesn't exist (negative or out of range), will return null. This method will never throw an error.
getRange(int start, int end) Iterable<T>
Returns an Iterable that iterates over the objects in the range start inclusive to end exclusive.
indexOf(T element, [int start = 0]) int
Returns the index of the first element in the list.
indexWhere(Predicate<T> test, [int start = 0]) int
Returns the first index in the list that satisfies the provided test.
inits() Iterable<Iterable<T>>
inRange(int index) bool
Returns true if the given index is valid (between 0 and length - 1).
insert(int index, T element) IList<T>
Inserts the object at position index in this list and returns a new immutable list.
insertAll(int index, Iterable<T> iterable) IList<T>
Inserts all objects of iterable at position index in this list.
insertBy(Order<T> order, T element) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert element into the list at the first position where it is less than or equal to the next element based on order (Order).
insertWith<A>(A extract(T instance), Order<A> order, T element) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert element into the Iterable at the first position where it is less than or equal to the next element based on order (Order).
intersect(Iterable<T> iterable) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return the intersection of two Iterable (all the elements that both Iterable have in common).
intersectsWith(Iterable<T> other) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns true if this Iterable has any items in common with the other Iterable. This method is as performant as possible, but it will be faster if any of the Iterables is a Set or an ISet.
intersperse(T middle) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return an Iterable placing an middle in between elements of the this Iterable.
isFirst(T item) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if the given item is the same (by identity) as the first iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you have the first item. For example:
isLast(T item) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if the given item is the same (by identity) as the last iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you have the last item. For example:
isNotFirst(T item) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if the given item is NOT the same (by identity) as the first iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you don't have the first item. For example:
isNotLast(T item) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if the given item is NOT the same (by identity) as the last iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you don't have the last item. For example:
join([String separator = ""]) String
Converts each element to a String and concatenates the strings with the separator in-between each concatenation.
override
lastIndexOf(T element, [int? start]) int
Returns the last index of element in this list.
lastIndexWhere(Predicate<T> test, [int? start]) int
Returns the last index in the list that satisfies the provided test.
lastOr(T orElse) → T
Returns the last element, or orElse if the list is empty.
lastWhere(Predicate<T> test, {T orElse()?}) → T
Returns the last element that satisfies the given predicate test.
override
lengthCompare(Iterable others) bool
Compare with others length
map<E>(E f(T element), {ConfigList? config}) Iterable<E>
Returns a new lazy Iterable with elements that are created by calling f on each element of this Iterable in iteration order.
override
mapIndexedAndLast<R>(R convert(int index, T item, bool isLast)) Iterable<R>

Available on Iterable<T>, provided by the FicIterableExtension extension

Maps each element and its index to a new value. This is similar to mapIndexed but also tells you which item is the last.
mapNotNull<E>(E? f(T? e)) Iterable<E>

Available on Iterable<T?>, provided by the FicIterableExtensionTypeNullable extension

Similar to map, but MAY return a non-nullable type.
mapWithIndex<B>(B toElement(T t, int index)) Iterable<B>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Same as map but provides also the index of each mapped element in the mapping function (toElement).
maximumBy(Order<T> order) Option<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

The largest element of this Iterable based on order.
maxLength(int maxLength, {int priority(T a, T b)?}) IList<T>
If the list has more than maxLength elements, remove the last elements so it remains with only maxLength elements. If the list has maxLength or less elements, doesn't change anything.
minimumBy(Order<T> order) Option<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

The least element of this Iterable based on order.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notElem(T element) bool

Available on Iterable<T>, provided by the ElementalOnIterable extension

Check if element is not contained inside this Iterable.
partition(bool test(T t)) → (Iterable<T>, Iterable<T>)

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return a record containing the values of this Iterable for which test is false in the first element, and the values for which it is true in the second element.
prepend(T element) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert element at the beginning of the Iterable.
prependAll(Iterable<T> other) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Insert all the elements inside other at the beginning of the Iterable.
process({bool test(IList<T> list, int index, T item)?, required Iterable<T>? convert(IList<T> list, int index, T item)}) IList<T>
Allows for complex processing of a list.
put(int index, T value) IList<T>
This is the equivalent to void operator []=(int index, T value); for the IList. Sets the value at the given index in the list to value or throws a RangeError if index is out of bounds.
reduce(T combine(T value, T element)) → T
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
override
remove(T item) IList<T>
Removes the first occurrence of item from this IList.
removeAll(Iterable<T?> items) IList<T>
Removes all occurrences of all items from this list. Same as calling removeMany for each item in items.
removeAt(int index, [Output<T>? removedItem]) IList<T>
Removes the object at position index from this list.
removeDuplicates() IList<T>
Removes duplicates (but keeps items which appear only once, plus the first time other items appear).
removeLast([Output<T>? removedItem]) IList<T>
Removes the last object from this list. This method reduces the length of this by one.
removeMany(T item) IList<T>
Removes all occurrences of item from this list.
removeNulls() IList<T>
Removes all nulls from this list.
removeNullsAndDuplicates() IList<T>
Removes duplicates (but keeps items which appear only once, plus the first time other items appear).
removeRange(int start, int end) IList<T>
Removes the objects in the range start inclusive to end exclusive.
removeWhere(Predicate<T> test) IList<T>
Removes all objects from this list that satisfy test.
replace(int index, T value) IList<T>
This is the equivalent to void operator []=(int index, T value); for the IList. Sets the value at the given index in the list to value or throws a RangeError if index is out of bounds.
replaceAll({required T from, required T to}) IList<T>
Finds all occurrences of from, and replace them with to.
replaceAllWhere(Predicate<T> test, T to) IList<T>
Finds all items that satisfy the provided test, and replace it with to.
replaceBy(int index, T transform(T item)) IList<T>
Returns a new IList, replacing the object at position index with the result of calling the function transform. This function gets the previous object at position index as a parameter.
replaceFirst({required T from, required T to}) IList<T>
Finds the first occurrence of from, and replace it with to.
replaceFirstWhere(bool test(T item), T replacement(T? item), {bool addIfNotFound = false}) IList<T>
Finds the first item that satisfies the provided test, and replace it with the result of replacement.
replaceRange(int start, int end, Iterable<T> replacement) IList<T>
Removes the objects in the range start inclusive to end exclusive and inserts the contents of replacement in its place.
restrict(T? item, {required T orElse}) → T

Available on Iterable<T>, provided by the FicIterableExtension extension

Restricts some item to one of those present in this iterable.
retainWhere(Predicate<T> test) IList<T>
Removes all objects from this list that fail to satisfy test.
same(IList<T>? other) bool
Will return true only if the lists internals are the same instances (comparing by identity). This will be fast even for very large lists, since it doesn't compare each item.
override
setAll(int index, Iterable<T> iterable) IList<T>
Overwrites objects of this with the objects of iterable, starting at position index in this list.
setRange(int start, int end, Iterable<T> iterable, [int skipCount = 0]) IList<T>
Copies the objects of iterable, skipping skipCount objects first, into the range start, inclusive, to end, exclusive, of the list.
shuffle([Random? random]) IList<T>
Shuffles the elements of this list randomly.
singleOr(T orElse) → T
Checks if the list has only one element, and returns that element. Return null if the list is empty or has more than one element.
singleWhere(Predicate<T> test, {T orElse()?}) → T
Returns the single element that satisfies test.
override
skip(int count) Iterable<T>
Returns an Iterable that provides all but the first count elements.
override
skipWhile(bool test(T value)) Iterable<T>
Returns an Iterable that skips leading elements while test is satisfied.
override
sort([int compare(T a, T b)?]) IList<T>
Sorts this list according to the order specified by the compare function.
sortBy(Order<T> order) List<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Sort this List based on order (Order).
sortedLike(Iterable ordering) List<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns a list, sorted according to the order specified by the ordering iterable. Items which don't appear in ordering will be included in the end, in their original order. Items of ordering which are not found in the original list are ignored.
sortedReversed([Comparator<T>? compare]) List<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Creates a reversed sorted list of the elements of the iterable.
sortLike(Iterable<T> ordering) IList<T>
Sorts this list according to the order specified by the ordering iterable. Items which don't appear in ordering will be included in the end, in no particular order.
sortOrdered([int compare(T a, T b)?]) IList<T>
Sorts this list according to the order specified by the compare function.
sortReversed([int compare(T a, T b)?]) IList<T>
Sorts this list in reverse order in relation to the default sort method.
sortWith<A>(A extract(T t), Order<A> order) List<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Sort this Iterable based on order of an object of type A extracted from T using extract.
sortWithDate(DateTime getDate(T instance)) List<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Sort this Iterable based on DateTime extracted from type T using getDate.
span(bool test(T t)) → (Iterable<T>, Iterable<T>)

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that satisfy test and second element is the remainder of the Iterable.
span(Predicate<T> p) → Tuple2<Iterable<T>, Iterable<T>>
Split list based on predicate p. (takeWhile p, dropWhile p)
splitAt(int index) → Tuple2<Iterable<T>, Iterable<T>>
Split the List at specified index
splitAt(int n) → (Iterable<T>, Iterable<T>)

Available on Iterable<T>, provided by the ElementalOnIterable extension

Return a record where first element is an Iterable with the first n elements of this Iterable, and the second element contains the rest of the Iterable.
sublist(int start, [int? end]) IList<T>
Returns a new list containing the elements between start and end.
sumBy<N extends num>(N mapper(T element)) → N

Available on Iterable<T>, provided by the FicIterableExtension extension

The sum of the values returned by the mapper function.
tails() Iterable<Iterable<T>>
take(int count) Iterable<T>
Returns an Iterable of the count first elements of this iterable.
override
takeWhile(bool test(T value)) Iterable<T>
Returns an Iterable of the leading elements satisfying test.
override
takeWhileLeft(bool test(T t)) Iterable<T>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Extract all elements starting from the first as long as test returns true.
toggle(T element) IList<T>
Removes the first instance of the element, if it exists in the list. Otherwise, adds it to the list.
toIList([ConfigList? config]) IList<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Creates an immutable list (IList) from the iterable.
toISet([ConfigSet? config]) ISet<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Creates an immutable set (ISet) from the iterable.
toJson(Object? toJsonT(T)) Object
Converts to JSon. Json serialization support for json_serializable with @JsonSerializable.
toList({bool growable = true}) List<T>
Creates a List containing the elements of this IList.
override
toSet() Set<T>
Creates a Set containing the same elements as this IList.
override
toString([bool? prettyPrint]) String
Returns a string representation of (some of) the elements of this.
override
unorderedEqualItems(covariant Iterable? other) bool
Will return true only if the IList and the iterable items have the same number of elements, and the elements of the IList can be paired with the elements of the iterable, so that each pair is equal. This may be slow for very large lists, since it compares each item, one by one.
unzip() → Tuple2<Iterable<U>, Iterable<V>>

Available on Iterable<Tuple2<U, V>>, provided by the FICZipExtension extension

Iterable Tuple2 as Iterable
updateById(Iterable<T> newItems, dynamic id(T item)) List<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns a new list where newItems are added or updated, by their id (and the id is a function of the item), like so:
updateById(Iterable<T> newItems, dynamic id(T item)) IList<T>
Returns a new list where newItems are added or updated, by their id (and the id is a function of the item), like so:
where(Predicate<T> test) Iterable<T>
Returns an Iterable with all elements that satisfy the predicate test.
override
whereMoveToTheEnd(bool test(T item)) IList<T>
Moves all items that satisfy the provided test to the end of the list. Keeps the relative order of the moved items.
whereMoveToTheStart(bool test(T item)) IList<T>
Moves all items that satisfy the provided test to the start of the list. Keeps the relative order of the moved items.
whereNoDuplicates({dynamic by(T item)?, bool removeNulls = false}) Iterable<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Removes all duplicates, leaving only the distinct items. Optionally, you can provide an by function to compare the items.
whereNot(Predicate<T> test) Iterable<T>
Returns an Iterable with all elements that doest NOT satisfy the predicate test.
whereType<E>() Iterable<E>
Returns an Iterable with all elements that have type E.
override
withConfig(ConfigList config) IList<T>
Creates a new list with the given config.
withConfigFrom(IList<T> other) IList<T>
Returns a new list with the contents of the present IList, but the config of other.
zip<B>(Iterable<B> iterable) Iterable<(T, B)>

Available on Iterable<T>, provided by the ElementalOnIterable extension

zip is used to join elements at the same index from two different Iterable into one Iterable of a record.
zip(Iterable<T> otherIterable) Iterable<Tuple2<T, T>>
Aggregate two sources trimming by the shortest source
zipAll<U>(Iterable<U> otherIterable, {T currentFill(int index)?, U otherFill(int index)?}) Iterable<Tuple2<T?, U?>>
Aggregate two sources based on the longest source. Missing elements can be completed by passing a currentFill and otherFill methods or will be at null by default
zipWith<B, C>(C combine(T t, B b), Iterable<B> iterable) Iterable<C>

Available on Iterable<T>, provided by the ElementalOnIterable extension

Join elements at the same index from two different Iterable into one Iterable containing the result of calling combine on each element pair.
zipWithIndex() Iterable<Tuple2<int, T>>
Aggregate each element with corresponding index

Operators

operator +(Iterable<T> other) IList<T>
Returns the concatenation of this list and other. Returns a new list containing the elements of this list followed by the elements of other.
operator ==(Object other) bool
  • If isDeepEquals configuration is true: Will return true only if the list items are equal (and in the same order), and the list configurations are equal. This may be slow for very large lists, since it compares each item, one by one.

  • If isDeepEquals configuration is false: Will return true only if the lists internals are the same instances (comparing by identity). This will be fast even for very large lists, since it doesn't compare each item.

  • override
    operator [](int index) → T
    Returns the object at the given index in the list or throws a RangeError if index is out of bounds.

    Static Properties

    defaultConfig ConfigList
    Global configuration that specifies if, by default, the ILists use equality or identity for their operator ==. By default isDeepEquals: true (lists are compared by equality) and cacheHashCode = true.
    getter/setter pair
    flushFactor int
    Indicates the number of operations an IList may perform before it is eligible for auto-flush. Must be larger than 0.
    getter/setter pair

    Static Methods

    iterate<U>(U base, int count, Op<U> op) IList<U>
    Apply Op on previous state of base and return all results
    iterateWhile<U>(U base, Predicate<U> test, Op<U> op) IList<U>
    Apply Op on previous state of base while predicate pass then return all results
    orNull<T>(Iterable<T>? iterable, [ConfigList? config]) IList<T>?
    If Iterable is null, return null.
    resetAllConfigurations() → void
    See also: ImmutableCollection, ImmutableCollection.lockConfig, ImmutableCollection.isConfigLocked,flushFactor, defaultConfig
    override
    tabulate<U>(int count, U on(int at)) Iterable<U>
    tabulate2<U>(int count0, int count1, U on(int at0, int at1)) Iterable<Iterable<U>>
    tabulate3<U>(int count0, int count1, int count2, U on(int at0, int at1, int at2)) Iterable<Iterable<Iterable<U>>>
    tabulate4<U>(int count0, int count1, int count2, int count3, U on(int at0, int at1, int at2, int at3)) Iterable<Iterable<Iterable<Iterable<U>>>>
    tabulate5<U>(int count0, int count1, int count2, int count3, int count4, U on(int at0, int at1, int at2, int at3, int at4)) Iterable<Iterable<Iterable<Iterable<Iterable<U>>>>>