Zip<I1, I2> class Null safety

Zip is a list class with added functionality that pairs two equal matching iterables and combines the elements of the two iterables into a compound ZipItem that contains both of those elements. The added functionality is related to things therein such as: swap all elements, go from zip to map, check if an element is contained within any of the pairs, etc Like zip() in python

Inheritance
Available Extensions

Constructors

Zip(List<ZipItem<I1, I2>> _base)
Zip.castFromMap(Map map_)
factory
Zip.create(List<I1> a, List<I2> b)
factory
Zip.fromEvenListParity(List list)
Creates a Zip by pairing an even index with its next odd index The list must have an even length or you will encounter an ArgumentError ex:
factory
Zip.fromEvenListSplit(List list)
Creates a Zip by splitting the list in half and zipping the entries on the first half of the list with the entries of the equivalent index on the second half of the list. The list must have an even length or you will encounter an ArgumentError ex:
factory

Properties

base List<ZipItem<I1, I2>>
read-only
first ZipItem<I1, I2>
Returns the first element.
read / writeinherited
hashCode int
The hash code for this object.
read-onlyoverride
isEmpty bool
Whether this collection has no elements.
read-onlyinherited
isNotEmpty bool
Whether this collection has at least one element.
read-onlyinherited
item1List List<I1>
read-only
item2List List<I2>
read-only
iterator Iterator<ZipItem<I1, I2>>
Returns a new Iterator that allows iterating the elements of this Iterable.
read-onlyinherited
last ZipItem<I1, I2>
Returns the last element.
read / writeinherited
length int
Returns the number of elements in this.
read / writeinherited
reversed Iterable<ZipItem<I1, I2>>
An Iterable of the objects in this list in reverse order.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
single ZipItem<I1, I2>
Checks that this iterable has only one element, and returns that element.
read-onlyinherited

Methods

add(ZipItem<I1, I2> value) → void
Adds value to the end of this list, extending the length by one.
inherited
addAll(Iterable<ZipItem<I1, I2>> iterable) → void
Appends all objects of iterable to the end of this list.
inherited
addItem(I1 item1, I2 item2) → void
any(bool test(ZipItem<I1, I2>)) bool
Checks whether any element of this iterable satisfies test.
inherited
asMap() Map<int, ZipItem<I1, I2>>
An unmodifiable Map view of this list.
inherited
cast<T>() List<T>
Provides a view of this iterable as an iterable of R instances.
inherited
clear() → void
Removes all objects from this list; the length of the list becomes zero.
inherited
contains(Object? element) bool
Checks if item is any of the ZipItem entries, if the item is a ZipItem checks if it is in the base list itself.
copyWith({List<ZipItem<I1, I2>>? base}) Zip
elementAt(int index) ZipItem<I1, I2>
Returns the indexth element.
inherited
every(bool test(ZipItem<I1, I2>)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> f(ZipItem<I1, I2>)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
extendItems(List<I1> a, List<I2> b) Zip<I1, I2>
fillRange(int start, int end, [ZipItem<I1, I2>? fillValue]) → void
Overwrites a range of elements with fillValue.
inherited
firstWhere(bool test(ZipItem<I1, I2>), {ZipItem<I1, I2> orElse()?}) ZipItem<I1, I2>
Returns the first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, ZipItem<I1, I2> element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<ZipItem<I1, I2>> other) Iterable<ZipItem<I1, I2>>
Returns the lazy concatenation of this iterable and other.
inherited
forEach(void f(ZipItem<I1, I2>)) → void
Invokes action on each element of this iterable in iteration order.
inherited
getRange(int start, int end) Iterable<ZipItem<I1, I2>>
Creates an Iterable that iterates over a range of elements.
inherited
indexOf(ZipItem<I1, I2> element, [int start = 0]) int
The first index of element in this list.
inherited
indexWhere(bool test(ZipItem<I1, I2>), [int start = 0]) int
The first index in the list that satisfies the provided test.
inherited
insert(int index, ZipItem<I1, I2> element) → void
Inserts element at position index in this list.
inherited
insertAll(int index, Iterable<ZipItem<I1, I2>> iterable) → void
Inserts all objects of iterable at position index in this list.
inherited
join([String separator = '']) String
Converts each element to a String and concatenates the strings.
inherited
lastIndexOf(ZipItem<I1, I2> element, [int? start]) int
The last index of element in this list.
inherited
lastIndexWhere(bool test(ZipItem<I1, I2>), [int? start]) int
The last index in the list that satisfies the provided test.
inherited
lastWhere(bool test(ZipItem<I1, I2>), {ZipItem<I1, I2> orElse()?}) ZipItem<I1, I2>
Returns the last element that satisfies the given predicate test.
inherited
map<T>(T f(ZipItem<I1, I2>)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
reduce(ZipItem<I1, I2> combine(ZipItem<I1, I2> value, ZipItem<I1, I2> element)) ZipItem<I1, I2>
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
remove(Object? value) bool
Removes the first occurrence of value from this list.
inherited
removeAt(int index) ZipItem<I1, I2>
Removes the object at position index from this list.
inherited
removeLast() ZipItem<I1, I2>
Removes and returns the last object in this list.
inherited
removeRange(int start, int end) → void
Removes a range of elements from the list.
inherited
removeWhere(bool test(ZipItem<I1, I2>)) → void
Removes all objects from this list that satisfy test.
inherited
replaceRange(int start, int end, Iterable<ZipItem<I1, I2>> iterable) → void
Replaces a range of elements with the elements of replacements.
inherited
retainWhere(bool test(ZipItem<I1, I2>)) → void
Removes all objects from this list that fail to satisfy test.
inherited
retype<T>() List<T>
inherited
setAll(int index, Iterable<ZipItem<I1, I2>> iterable) → void
Overwrites elements with the objects of iterable.
inherited
setRange(int start, int end, Iterable<ZipItem<I1, I2>> 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(ZipItem<I1, I2>), {ZipItem<I1, I2> orElse()?}) ZipItem<I1, I2>
Returns the single element that satisfies test.
inherited
skip(int n) Iterable<ZipItem<I1, I2>>
Returns an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(ZipItem<I1, I2>)) Iterable<ZipItem<I1, I2>>
Returns an Iterable that skips leading elements while test is satisfied.
inherited
sort([int compare(ZipItem<I1, I2>, ZipItem<I1, I2>)?]) → void
Sorts this list according to the order specified by the compare function.
inherited
sublist(int start, [int? end]) List<ZipItem<I1, I2>>
Returns a new list containing the elements between start and end.
inherited
swapAll() Zip<I2, I1>
take(int n) Iterable<ZipItem<I1, I2>>
Returns a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(ZipItem<I1, I2>)) Iterable<ZipItem<I1, I2>>
Returns a lazy iterable of the leading elements satisfying test.
inherited
toJson() String
toList({bool growable = true}) List<ZipItem<I1, I2>>
Creates a List containing the elements of this Iterable.
inherited
toMap() Map<I1, I2>
toMapSwitched() Map<I2, I1>
toSet() Set<ZipItem<I1, I2>>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
A string representation of this object.
where(bool test(ZipItem<I1, I2>)) Iterable<ZipItem<I1, I2>>
Returns a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<T>() Iterable<T>
Returns a new lazy Iterable with all elements that have type T.
inherited

Operators

operator +(List<ZipItem<I1, I2>> other) List<ZipItem<I1, I2>>
Returns the concatenation of this list and other.
inherited
operator ==(Object other) bool
The equality operator.
override
operator [](int index) ZipItem<I1, I2>
The object at the given index in the list.
inherited
operator []=(int index, ZipItem<I1, I2> value) → void
Sets the value at the given index in the list to value.
inherited