UnmodifiableListFromIList<T> class
The UnmodifiableListFromIList is a relatively safe, unmodifiable List view that is built from an IList or another List. The construction of the UnmodifiableListFromIList is very fast, since it makes no copies of the given list items, but just uses it directly.
If you try to use methods that modify the UnmodifiableListFromIList, like add, it will throw an UnsupportedError.
If you create it from an IList, it is also very fast to lock the UnmodifiableListFromIList back into an IList.
How does it compare to Dart's native List.unmodifiable and UnmodifiableListView?
List.unmodifiable is slow, but it's always safe, because it is not a view, and actually creates a new list. On the other hand, both UnmodifiableListFromIList and UnmodifiableListView are fast, but if you create them from a regular List and then modify that original List, you will also be modifying the views. Also note, if you create an UnmodifiableListFromIList from an IList, then it's totally safe because the original IList can't be modified.
The only different between an UnmodifiableListFromIList and an UnmodifiableListView is that UnmodifiableListFromIList accepts both a List and an IList.
See also: ModifiableListFromIList
- Implemented types
-
- List<
T> - CanBeEmpty
- List<
- Mixed-in types
-
- ListMixin<
T>
- ListMixin<
- Available extensions
- Annotations
-
- @immutable
Constructors
-
UnmodifiableListFromIList.new(IList<
T> ? ilist) -
Create an unmodifiable List view of type UnmodifiableListFromIList, from an
ilist
. -
UnmodifiableListFromIList.fromList(List<
T> list) - Create an unmodifiable List view of type UnmodifiableListFromIList, from another List.
Properties
-
asComparableEntries
→ Iterable<
Entry< K, V> > -
Available on Iterable<
MapEntry is not Comparable. If you need to compare two iterables of MapEntry you can do this:MapEntry< , provided by the FicIterableOfMapEntryExtension extensionK, V> >no setter -
collect
→ ZIO<
R, E, IList< A> > -
Available on Iterable<
Alias for ZIO.collectIZIO< , provided by the ZIOIterableExt extensionR, E, A> >no setter -
collectDiscard
→ ZIO<
R, E, Unit> -
Available on Iterable<
Alias for ZIO.collectDiscardIZIO< , provided by the ZIOIterableExt extensionR, E, A> >no setter -
collectPar
→ ZIO<
R, E, IList< A> > -
Available on Iterable<
Alias for ZIO.collectParIZIO< , provided by the ZIOIterableExt extensionR, E, A> >no setter -
collectParDiscard
→ ZIO<
R, E, Unit> -
Available on Iterable<
Alias for ZIO.collectParDiscardIZIO< , provided by the ZIOIterableExt extensionR, E, A> >no setter - first ↔ T
-
The first element.
getter/setter pairinherited
-
firstOption
→ Option<
T> -
Available on Iterable<
Get the first element of the Iterable. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter - firstOrNull → T?
-
Available on Iterable<
The first element of this iterator, orT> , provided by the IterableExtensions extensionnull
if the iterable is empty.no setter -
flatten
→ Iterable<
T> -
Available on Iterable<
From aIterable< , provided by the ElementalOnIterableOfIterable extensionT> >Iterable<Iterable<T>>
return aIterable<T>
of their concatenation.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
head
→ Option<
T> -
Available on Iterable<
Get the first element of the Iterable. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter -
indexed
→ Iterable<
(int, T)> -
Available on Iterable<
Pairs of elements of the indices and elements of this iterable.T> , provided by the IterableExtensions extensionno setter -
init
→ Option<
Iterable< T> > -
Available on Iterable<
Return all the elements of a Iterable except the last one. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter - isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
T> -
A new
Iterator
that allows iterating the elements of thisIterable
.no setterinherited - last ↔ T
-
The last element.
getter/setter pairinherited
-
lastOption
→ Option<
T> -
Available on Iterable<
Get the last element of the Iterable. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter - lastOrNull → T?
-
Available on Iterable<
The last element of this iterable, orT> , provided by the IterableExtensions extensionnull
if the iterable is empty.no setter - length ↔ int
-
The number of objects in this list.
getter/setter pairoverride
-
lock
→ IList<
T?> ? -
Locks the list, returning an immutable list (IList).
no setter
-
lock
→ IList<
T> -
Available on List<
Locks the list, returning an immutable list (IList).T> , provided by the FicListExtension extensionno setter -
lockUnsafe
→ IList<
T> -
Available on List<
Locks the list, returning an immutable list (IList).T> , provided by the FicListExtension extensionno setter -
nonNulls
→ Iterable<
T> -
Available on Iterable<
The non-T?> , provided by the NullableIterableExtensions extensionnull
elements of this iterable.no setter -
raceAll
→ ZIO<
R, E, A> -
Available on Iterable<
Alias for ZIO.raceAllIZIO< , provided by the ZIOIterableExt extensionR, E, A> >no setter -
reversed
→ Iterable<
T> -
An Iterable of the objects in this list in reverse order.
no setterinherited
-
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 - 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.
no setterinherited
- singleOrNull → T?
-
Available on Iterable<
The single element of this iterator, orT> , provided by the IterableExtensions extensionnull
.no setter -
tail
→ Option<
Iterable< T> > -
Available on Iterable<
Return all the elements of a Iterable except the first one. If the Iterable is empty, return None.T> , provided by the ElementalOnIterable extensionno setter -
toJS
→ JSArray<
T> -
Available on List<
Converts this List to a JSArray by either casting, unwrapping, or cloning the List.T> , provided by the ListToJSArray extensionno setter -
toJSProxyOrRef
→ JSArray<
T> -
Available on List<
Converts this List to a JSArray by either casting, unwrapping, or proxying the List.T> , provided by the ListToJSArray extensionno setter -
wait
→ Future<
List< T> > -
Available on Iterable<
Waits for futures in parallel.Future< , provided by the FutureIterable extensionT> >no setter
Methods
-
add(
T? value) → void -
Adds
value
to the end of this list, extending the length by one.override -
addAll(
Iterable< T> values) → void -
Appends all objects of
iterable
to the end of this list.override -
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 -
all(
bool test(T t)) → bool -
Available on Iterable<
Checks whether every element of this Iterable satisfiesT> , provided by the ElementalOnIterable extensiontest
. -
any(
bool test(T element)) → bool -
Checks whether any element of this iterable satisfies
test
.inherited -
anyIs(
T value) → bool -
Available on Iterable<
ReturnsT> , provided by the FicIterableExtension extensiontrue
if any item is equal tovalue
. -
ap<
B> (Iterable< B Function(T)> iterable) → Iterable<B> -
Available on Iterable<
Apply all the functions insideT> , provided by the ElementalOnIterable extensioniterable
to this Iterable. -
append(
T element) → Iterable< T> -
Available on Iterable<
InsertT> , provided by the ElementalOnIterable extensionelement
at the end of the Iterable. -
asList(
) → List< T> -
Available on Iterable<
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.T> , provided by the FicIterableExtension extension -
asMap(
) → Map< int, T> -
An unmodifiable Map view of this list.
inherited
-
asNameMap(
) → Map< String, T> -
Available on Iterable<
Creates a map from the names of enum values to the values.T> , provided by the EnumByName extension -
asSet(
) → Set< T> -
Available on Iterable<
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.T> , provided by the FicIterableExtension extension -
averageBy<
N extends num> (N mapper(T element)) → double -
Available on Iterable<
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:T> , provided by the FicIterableExtension extension -
breakI(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that do not satisfyT> , provided by the ElementalOnIterable extensiontest
and second element is the remainder of the Iterable. -
byName(
String name) → T -
Available on Iterable<
Finds the enum value in this list with nameT> , provided by the EnumByName extensionname
. -
cast<
R> () → List< R> -
Returns a view of this list as a list of
R
instances.inherited -
clear(
) → void -
Removes all objects from this list; the length of the list becomes zero.
inherited
-
compareAsSets(
List other) → bool -
Available on List<
ReturnT> , provided by the FicListExtension extensiontrue
if 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 -
concat(
Iterable< T> other) → Iterable<T> -
Available on Iterable<
Creates the lazy concatenation of this Iterable andT> , provided by the ElementalOnIterable extensionother
. -
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element
.inherited -
deepEquals(
Iterable? other, {bool ignoreOrder = false}) → bool -
Available on Iterable<
Compare all items, in order or not, according toT> , provided by the FicIterableExtension extensionignoreOrder
, using operator ==. Return true if they are all the same, in the same order. -
deepEqualsByIdentity(
Iterable? other, {bool ignoreOrder = false}) → bool -
Available on Iterable<
Return true if they are all the same, in the same order. Compare all items, in order or not, according toT> , provided by the FicIterableExtension extensionignoreOrder
, using identical. Return true if they are all the same, in the same order. -
delete(
T element) → Iterable< T> -
Available on Iterable<
Remove the first occurrence ofT> , provided by the ElementalOnIterable extensionelement
from this Iterable. -
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 extensionid
function 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 extensiontest
predicate (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 extensiontest
predicate (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 thekey
function. -
drop(
int n) → Iterable< T> -
Available on Iterable<
Return the suffix of this Iterable after the firstT> , provided by the ElementalOnIterable extensionn
elements. -
dropRight(
[int count = 1]) → Iterable< T> -
Available on Iterable<
Drops the lastT> , provided by the ElementalOnIterable extensioncount
element of this iterable. -
dropWhileLeft(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Remove all elements starting from the first as long asT> , provided by the ElementalOnIterable extensiontest
returnstrue
. -
elem(
T element) → bool -
Available on Iterable<
Check ifT> , provided by the ElementalOnIterable extensionelement
is contained inside this Iterable. -
elementAt(
int index) → T -
Returns the
index
th element.inherited -
elementAtOrNull(
int index) → T? -
Available on Iterable<
The element at positionT> , provided by the IterableExtensions extensionindex
of this iterable, ornull
. -
every(
bool test(T element)) → bool -
Checks whether every element of this iterable satisfies
test
.inherited -
everyIs(
T value) → bool -
Available on Iterable<
ReturnsT> , provided by the FicIterableExtension extensiontrue
if all items are equal tovalue
. -
expand<
T> (Iterable< T> f(T element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
fillRange(
int start, int end, [T? fill]) → void -
Overwrites a range of elements with
fillValue
.inherited -
filter(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Returns the list of those elements that satisfyT> , provided by the ElementalOnIterable extensiontest
. -
filterWithIndex(
bool test(T t, int index)) → Iterable< T> -
Available on Iterable<
Returns the list of those elements that satisfyT> , provided by the ElementalOnIterable extensiontest
. -
findDuplicates(
) → Set< T> -
Available on Iterable<
Finds duplicates and then returns a Set with the duplicated elements. If there are no duplicates, an empty Set is returned.T> , provided by the FicIterableExtension extension -
firstWhere(
bool test(T element), {T orElse()?}) → T -
The first element that satisfies the given predicate
test
.inherited -
flatMap<
B> (Iterable< B> toElements(T t)) → Iterable<B> -
Available on Iterable<
For each element of the Iterable apply functionT> , provided by the ElementalOnIterable extensiontoElements
and flat the result. -
flatMapWithIndex<
B> (Iterable< B> toElements(T t, int index)) → Iterable<B> -
Available on Iterable<
Same asT> , provided by the ElementalOnIterable extensionflatMap
(extend
) but provides also theindex
of each mapped element in the mapping function (toElements
). -
fold<
T> (T initialValue, T combine(T previousValue, T element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
foldLeft<
B> (B initialValue, B combine(B b, T t)) → B -
Available on Iterable<
Fold this Iterable into a single value by aggregating each element of the list from the first to the last.T> , provided by the ElementalOnIterable extension -
foldLeftWithIndex<
B> (B initialValue, B combine(B previousValue, T element, int index)) → B -
Available on Iterable<
Same asT> , provided by the ElementalOnIterable extensionfoldLeft
(fold
) but provides also theindex
of each mapped element in thecombine
function. -
followedBy(
Iterable< T> other) → Iterable<T> -
Creates the lazy concatenation of this iterable and
other
.inherited -
forEach(
void action(T element)) → void -
Invokes
action
on each element of this iterable in iteration order.inherited -
get(
int index, {T orElse(int index)?}) → T -
Available on List<
Returns theT> , provided by the FicListExtension extensionindex
th element. If that index doesn't exist (negative, or out of range), will return the result of callingorElse
. In this case, iforElse
is 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 extensionindex
th element, and then apply themap
function to it, returning the result. If that index doesn't exist (negative, or out of range), will themap
method will be called withinRange
false andvalue
null. -
getOrNull(
int index) → T? -
Available on List<
Returns theT> , provided by the FicListExtension extensionindex
th 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> -
Creates an Iterable that iterates over a range of elements.
inherited
-
indexOf(
Object? element, [int start = 0]) → int -
The first index of
element
in this list.inherited -
indexWhere(
bool test(T element), [int start = 0]) → int -
The first index in the list that satisfies the provided
test
.inherited -
insert(
int index, T element) → void -
Inserts
element
at positionindex
in this list.inherited -
insertAll(
int index, Iterable< T> iterable) → void -
Inserts all objects of
iterable
at positionindex
in this list.inherited -
insertBy(
Order< T> order, T element) → Iterable<T> -
Available on Iterable<
InsertT> , provided by the ElementalOnIterable extensionelement
into the list at the first position where it is less than or equal to the next element based onorder
(Order). -
insertWith<
A> (A extract(T instance), Order< A> order, T element) → Iterable<T> -
Available on Iterable<
InsertT> , provided by the ElementalOnIterable extensionelement
into the Iterable at the first position where it is less than or equal to the next element based onorder
(Order). -
intersect(
Iterable< T> iterable) → Iterable<T> -
Available on Iterable<
Return the intersection of two Iterable (all the elements that both Iterable have in common).T> , provided by the ElementalOnIterable extension -
intersectsWith(
Iterable< T> other) → bool -
Available on Iterable<
Returns true if this Iterable has any items in common with theT> , provided by the FicIterableExtension extensionother
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<
Return an Iterable placing anT> , provided by the ElementalOnIterable extensionmiddle
in between elements of the this Iterable. -
isFirst(
T item) → bool -
Available on Iterable<
Return true if the givenT> , provided by the FicIterableExtension extensionitem
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<
Return true if the givenT> , provided by the FicIterableExtension extensionitem
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<
Return true if the givenT> , provided by the FicIterableExtension extensionitem
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<
Return true if the givenT> , provided by the FicIterableExtension extensionitem
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.
inherited
-
lastIndexOf(
Object? element, [int? start]) → int -
The last index of
element
in this list.inherited -
lastIndexWhere(
bool test(T element), [int? start]) → int -
The last index in the list that satisfies the provided
test
.inherited -
lastWhere(
bool test(T element), {T orElse()?}) → T -
The last element that satisfies the given predicate
test
.inherited -
map<
T> (T f(T element)) → Iterable< T> -
The current elements of this iterable modified by
toElement
.inherited -
mapIndexedAndLast<
R> (R convert(int index, T item, bool isLast)) → Iterable< R> -
Available on Iterable<
Maps each element and its index to a new value. This is similar toT> , provided by the FicIterableExtension extensionmapIndexed
but also tells you which item is the last. -
mapNotNull<
E> (E? f(T? e)) → Iterable< E> -
Available on Iterable<
Similar to map, but MAY return a non-nullable type.T?> , provided by the FicIterableExtensionTypeNullable extension -
mapWithIndex<
B> (B toElement(T t, int index)) → Iterable< B> -
Available on Iterable<
Same asT> , provided by the ElementalOnIterable extensionmap
but provides also theindex
of each mapped element in the mapping function (toElement
). -
maximumBy(
Order< T> order) → Option<T> -
Available on Iterable<
The largest element of this Iterable based onT> , provided by the ElementalOnIterable extensionorder
. -
minimumBy(
Order< T> order) → Option<T> -
Available on Iterable<
The least element of this Iterable based onT> , provided by the ElementalOnIterable extensionorder
. -
moveToTheEnd(
T item) → void -
Available on List<
Moves the first occurrence of theT> , provided by the FicListExtension extensionitem
to the end of the list. -
moveToTheFront(
T item) → void -
Available on List<
Moves the first occurrence of theT> , provided by the FicListExtension extensionitem
to the start of the list. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notElem(
T element) → bool -
Available on Iterable<
Check ifT> , provided by the ElementalOnIterable extensionelement
is not contained inside this Iterable. -
partition(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record containing the values of this Iterable for whichT> , provided by the ElementalOnIterable extensiontest
isfalse
in the first element, and the values for which it istrue
in the second element. -
prepend(
T element) → Iterable< T> -
Available on Iterable<
InsertT> , provided by the ElementalOnIterable extensionelement
at the beginning of the Iterable. -
prependAll(
Iterable< T> other) → Iterable<T> -
Available on Iterable<
Insert all the elements insideT> , provided by the ElementalOnIterable extensionother
at the beginning of the Iterable. -
reduce(
T combine(T previousValue, T element)) → T -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
remove(
Object? element) → bool -
Removes the first occurrence of
value
from this list.inherited -
removeAt(
int index) → T -
Removes the object at position
index
from this list.inherited -
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 extensionid
function to compare the items. -
removeLast(
) → T -
Removes and returns the last object in this list.
inherited
-
removeNulls(
) → void -
Available on List<
Removes allT> , provided by the FicListExtension extensionnull
s from the List. -
removeRange(
int start, int end) → void -
Removes a range of elements from the list.
inherited
-
removeWhere(
bool test(T element)) → void -
Removes all objects from this list that satisfy
test
.inherited -
replaceRange(
int start, int end, Iterable< T> newContents) → void -
Replaces a range of elements with the elements of
replacements
.inherited -
restrict(
T? item, {required T orElse}) → T -
Available on Iterable<
Restricts some item to one of those present in this iterable.T> , provided by the FicIterableExtension extension -
retainWhere(
bool test(T element)) → void -
Removes all objects from this list that fail to satisfy
test
.inherited -
setAll(
int index, Iterable< T> iterable) → void -
Overwrites elements with the objects of
iterable
.inherited -
setRange(
int start, int end, Iterable< T> iterable, [int skipCount = 0]) → void -
Writes some elements of
iterable
into a range of this list.inherited -
shuffle(
[Random? random]) → void -
Shuffles the elements of this list randomly.
inherited
-
singleWhere(
bool test(T element), {T orElse()?}) → T -
The single element that satisfies
test
.inherited -
skip(
int count) → Iterable< T> -
Creates an Iterable that provides all but the first
count
elements.inherited -
skipWhile(
bool test(T element)) → Iterable< T> -
Creates an
Iterable
that skips leading elements whiletest
is satisfied.inherited -
sort(
[int compare(T a, T b)?]) → void -
Sorts this list according to the order specified by the
compare
function.inherited -
sortBy(
Order< T> order) → List<T> -
Available on Iterable<
Sort this List based onT> , provided by the ElementalOnIterable extensionorder
(Order). -
sortedLike(
Iterable ordering) → List< T> -
Available on Iterable<
Returns a list, sorted according to the order specified by theT> , provided by the FicIterableExtension extensionordering
iterable. Items which don't appear inordering
will be included in the end, in their original order. Items ofordering
which are not found in the original list are ignored. -
sortedReversed(
[Comparator< T> ? compare]) → List<T> -
Available on Iterable<
Creates a reversed sorted list of the elements of the iterable.T> , provided by the FicIterableExtension extension -
sortLike(
Iterable ordering) → void -
Available on List<
Sorts this list according to the order specified by theT> , provided by the FicListExtension extensionordering
iterable. Items which don't appear inordering
will be included in the end, in their original order. Items ofordering
which 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 extensioncompare
function. -
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 -
sortWith<
A> (A extract(T t), Order< A> order) → List<T> -
Available on Iterable<
Sort this Iterable based onT> , provided by the ElementalOnIterable extensionorder
of an object of typeA
extracted fromT
usingextract
. -
sortWithDate(
DateTime getDate(T instance)) → List< T> -
Available on Iterable<
Sort this Iterable based on DateTime extracted from typeT> , provided by the ElementalOnIterable extensionT
usinggetDate
. -
span(
bool test(T t)) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that satisfyT> , provided by the ElementalOnIterable extensiontest
and second element is the remainder of the Iterable. -
splitAt(
int n) → (Iterable< T> , Iterable<T> ) -
Available on Iterable<
Return a record where first element is an Iterable with the firstT> , provided by the ElementalOnIterable extensionn
elements of this Iterable, and the second element contains the rest of the Iterable. -
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 extensionlength
items. -
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 -
sublist(
int start, [int? end]) → List< T> -
Returns a new list containing the elements between
start
andend
.inherited -
sumBy<
N extends num> (N mapper(T element)) → N -
Available on Iterable<
The sum of the values returned by theT> , provided by the FicIterableExtension extensionmapper
function. -
take(
int count) → Iterable< T> -
Creates a lazy iterable of the
count
first elements of this iterable.inherited -
takeWhile(
bool test(T element)) → Iterable< T> -
Creates a lazy iterable of the leading elements satisfying
test
.inherited -
takeWhileLeft(
bool test(T t)) → Iterable< T> -
Available on Iterable<
Extract all elements starting from the first as long asT> , provided by the ElementalOnIterable extensiontest
returnstrue
. -
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
. -
toIList(
[ConfigList? config]) → IList< T> -
Available on Iterable<
Creates an immutable list (IList) from the iterable.T> , provided by the FicIterableExtension extension -
toISet(
[ConfigSet? config]) → ISet< T> -
Available on Iterable<
Creates an immutable set (ISet) from the iterable.T> , provided by the FicIterableExtension extension -
toList(
{bool growable = true}) → List< T> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< T> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unzip(
) → Tuple2< Iterable< U> , Iterable<V> > -
Available on Iterable<
Iterable Tuple2 as IterableTuple2< , provided by the FICZipExtension extensionU, V> > -
updateById(
Iterable< T> newItems, dynamic id(T item)) → List<T> -
Available on Iterable<
Returns a new list whereT> , provided by the FicIterableExtension extensionnewItems
are added or updated, by theirid
(and theid
is a function of the item), like so: -
where(
bool test(T element)) → Iterable< T> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test
.inherited -
whereMoveToTheEnd(
bool test(T item)) → void -
Available on List<
Moves all items that satisfy the providedT> , provided by the FicListExtension extensiontest
to 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 extensiontest
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<
Removes all duplicates, leaving only the distinct items. Optionally, you can provide anT> , provided by the FicIterableExtension extensionby
function to compare the items. -
whereType<
T> () → Iterable< T> -
Creates a new lazy Iterable with all elements that have type
T
.inherited -
withNullsRemoved(
) → List< T> -
Available on List<
Returns a new List with allT?> , provided by the FicListExtensionNullable extensionnull
s removed. This may return a list with a non-nullable type. -
zip<
B> (Iterable< B> iterable) → Iterable<(T, B)> -
Available on Iterable<
T> , provided by the ElementalOnIterable extensionzip
is used to join elements at the same index from two different Iterable into one Iterable of a record. -
zipWith<
B, C> (C combine(T t, B b), Iterable< B> iterable) → Iterable<C> -
Available on Iterable<
Join elements at the same index from two different Iterable into one Iterable containing the result of callingT> , provided by the ElementalOnIterable extensioncombine
on each element pair.
Operators
-
operator +(
List< T> other) → List<T> -
Returns the concatenation of this list and
other
.inherited -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → T -
The object at the given
index
in the list.override -
operator []=(
int index, T? value) → void -
Sets the value at the given
index
in the list tovalue
.override