df_collection library

A package designed to extend Dart collections by offering additional functionality.

Classes

BoolList
A space-efficient list of boolean values.
CanonicalizedMap<C, K, V>
A map whose keys are converted to canonical values of type C.
CaseInsensitiveEquality
String equality that's insensitive to differences in ASCII case.
CombinedIterableView<T>
A view of several iterables combined sequentially into a single iterable.
CombinedListView<T>
A view of several lists combined into a single list.
CombinedMapView<K, V>
Returns a new map that represents maps flattened into a single map.
CsvUtility
DeepCollectionEquality
Deep equality on collections.
DefaultEquality<E>
Equality of objects that compares only the natural equality of the objects.
DelegatingIterable<E>
An Iterable that delegates all operations to a base iterable.
DelegatingList<E>
A List that delegates all operations to a base list.
DelegatingMap<K, V>
A Map that delegates all operations to a base map.
DelegatingQueue<E>
A Queue that delegates all operations to a base queue.
DelegatingSet<E>
A Set that delegates all operations to a base set.
Equality<E>
A generic equality relation on objects.
EqualityBy<E, F>
Equality of objects based on derived values.
EqualityMap<K, V>
A Map whose key equality is determined by an Equality object.
EqualitySet<E>
A Set whose key equality is determined by an Equality object.
HeapPriorityQueue<E>
Heap based priority queue.
IdentityEquality<E>
Equality of objects that compares only the identity of the objects.
IterableEquality<E>
Equality on iterables.
IterableZip<T>
Iterable that iterates over lists of values from other iterables.
JsonUtility
ListEquality<E>
Equality on lists.
ListSlice<E>
A list view of a range of another list.
MapEquality<K, V>
Equality on maps.
MapKeySet<E>
An unmodifiable Set view of the keys of a Map.
MapValueSet<K, V>
Creates a modifiable Set view of the values of a Map.
MultiEquality<E>
Combines several equalities into a single equality.
NonGrowableListMixin<E>
Mixin class that implements a throwing version of all list operations that change the List's length.
NonGrowableListView<E>
A fixed-length list.
PriorityQueue<E>
A priority queue is a priority based work-list of elements.
QueueList<E>
A class that efficiently implements both Queue and List.
SetEquality<E>
Equality of sets.
UnionSet<E>
A single set that provides a view of the union over a set of sets.
UnionSetController<E>
A controller that exposes a view of the union of a collection of sets.
UnmodifiableListView<E>
An unmodifiable List view of another List.
UnmodifiableMapMixin<K, V>
Mixin class that implements a throwing version of all map operations that change the Map.
UnmodifiableMapView<K, V>
View of a Map that disallow modifying the map.
UnmodifiableSetMixin<E>
Mixin class that implements a throwing version of all set operations that change the Set.
UnmodifiableSetView<E>
An unmodifiable set.
UnorderedIterableEquality<E>
Equality of the elements of two iterables without considering order.

Extensions

CartesianProductOnIterableExt on Iterable<Iterable<T>>
ChunkedOnIterableExt on Iterable<T>
ComparatorExtension on Comparator<T>
Extensions on comparator functions.
DeepGetOnMapExt on Map
GenericTypeOnIterableExt on Iterable<T>
GenericTypeOnMapExt on Map<K, V>
IterableComparableExtension on Iterable<T>
Extensions that apply to iterables of Comparable elements.
IterableDoubleExtension on Iterable<double>
Extension on iterables of double.
IterableExtension on Iterable<T>
Extensions that apply to all iterables.
IterableIntegerExtension on Iterable<int>
Extension on iterables of integers.
IterableIterableExtension on Iterable<Iterable<T>>
Extensions on iterables whose elements are also iterables.
IterableNullableExtension on Iterable<T?>
Extensions that apply to iterables with a nullable element type.
IterableNumberExtension on Iterable<num>
Extensions that apply to iterables of numbers.
JoinWithLastSeparatorOnIterableExt on Iterable
ListComparableExtensions on List<E>
Various extensions on lists of comparable elements.
ListExtensions on List<E>
Various extensions on lists of arbitrary elements.
MapKeysAndValyesOnMapExt on Map<K1, V1>
MapWithDefaultOnMapExt on Map<K, V>
MaybeAddToIterableExt on Iterable<T>
MaybeAddToListExt on List<T>
MaybeAddToMapExt on Map<T1, T2>
MaybeAddToSetExt on Set<T>
NonNullKeysOnMapExt on Map<K?, V>
NonNullsOnMapExt on Map<K?, V?>
NonNullValuesOnMapExt on Map<K, V?>
NullIfEmptyOnIterableExt on Iterable<T>
NullIfEmptyOnListExt on List<T>
NullIfEmptyOnMapExt on Map<T1, T2>
NullIfEmptyOnQueueExt on Queue<T>
NullIfEmptyOnSetExt on Set<T>
SetNestedValueOnMapExt on Map
TakeLastOnIterableExt on Iterable<T>
ToMapOnIterableExt on Iterable<MapEntry<K, V>>
TraverseMapOnMapExt on Map<K, V>
TryMergeOnIterableExt on Iterable<Iterable<T>?>
TryReduceOnIterableExt on Iterable<T>
UniqueOnIterableExt on Iterable<T>
UniqueOnMapEntryIterableExt on Iterable<MapEntry<K, V>>
UnmodifiableOnListExt on List<T>
UnmodifiableOnMapExt on Map<K, V>
UnmodifiableOnSetExt on Set<T>

Functions

binarySearch<E>(List<E> sortedList, E value, {int compare(E, E)?}) int
Returns a position of the value in sortedList, if it is there.
cartesianProduct<T>(Iterable<Iterable<T>> source, T combinator(T a, T b)) Iterable<T>
Creates the Cartesian product of the iterables and combines each resulting pair using the combinator function.
chunked<T>(Iterable<T> source, int chunkSize) Iterable<Iterable<T>>
Splits the source into chunks of a maximum size specified by chunkSize.
combinedOrderedStringId(List<String> ids) String
Generates an ordered ID from a list of unordered IDs, that can be used to identify the list of IDs.
compareAsciiLowerCase(String a, String b) int
Compares a and b lexically, converting ASCII letters to lower case.
compareAsciiLowerCaseNatural(String a, String b) int
Compares strings a and b according to lower-case natural sort ordering.
compareAsciiUpperCase(String a, String b) int
Compares a and b lexically, converting ASCII letters to upper case.
compareAsciiUpperCaseNatural(String a, String b) int
Compares strings a and b according to upper-case natural sort ordering.
compareNatural(String a, String b) int
Compares strings a and b according to natural sort ordering.
deepGet(Map? map, String path, {String separator = '.'}) → dynamic
Safely retrieves and converts a value from a nested data structure using a dot-separated path.
deepGetFromSegments(Map? map, Iterable pathSegments) → dynamic
Safely retrieves and converts a value from a nested data structure using a list of path pathSegments.
equalsIgnoreAsciiCase(String a, String b) bool
Checks if strings a and b differ only on the case of ASCII letters.
getSetDifference<T>(Set<T> before, Set<T> after) Set<T>
Returns the difference between two sets.
groupBy<S, T>(Iterable<S> values, T key(S)) Map<T, List<S>>
Groups the elements in values by the value returned by key.
hashIgnoreAsciiCase(String string) int
Hash code for a string which is compatible with equalsIgnoreAsciiCase.
insertionSort<E>(List<E> elements, {int compare(E, E)?, int start = 0, int? end}) → void
Sort a list between start (inclusive) and end (exclusive) using insertion sort.
lastBy<S, T>(Iterable<S> values, T key(S)) Map<T, S>
Associates the elements in values by the value returned by key.
lowerBound<E>(List<E> sortedList, E value, {int compare(E, E)?}) int
Returns the first position in sortedList that does not compare less than value.
mapMap<K1, V1, K2, V2>(Map<K1, V1> map, {K2 key(K1, V1)?, V2 value(K1, V1)?}) Map<K2, V2>
Creates a new map from map with new keys and values.
maxBy<S, T>(Iterable<S> values, T orderBy(S), {int compare(T, T)?}) → S?
Returns the element of values for which orderBy returns the maximum value.
maybeAddToIterable<T>(Iterable<T>? source, Iterable<T>? add) Iterable<T>?
Adds add to source if both are not null.
maybeAddToList<T>(List<T>? source, List<T>? add) List<T>?
Adds add to source if both are not null.
maybeAddToMap<T1, T2>(Map<T1, T2>? source, Map<T1, T2>? add) Map<T1, T2>?
Adds add to source if both are not null.
maybeAddToSet<T>(Set<T>? source, Set<T>? add) Set<T>?
Adds add to source if both are not null.
mergeDataDeep(dynamic a, dynamic b, [dynamic elseFilter(dynamic)?]) → dynamic
mergeDataDeepIncludeCallsToJson(dynamic a, dynamic b) → dynamic
mergeDataDeepIncludeCallsToMap(dynamic a, dynamic b) → dynamic
mergeIterables(dynamic a, dynamic b) Iterable
mergeListsSetsOrQueues(Iterable a, Iterable b, [dynamic elseFilter(dynamic)?]) Iterable
mergeMaps<K, V>(Map<K, V> map1, Map<K, V> map2, {V value(V, V)?}) Map<K, V>
Returns a new map with all key/value pairs in both map1 and map2.
mergeMapsDeep<K, V>(List<Map<K, V>> maps) Map<K, V>
mergeSort<E>(List<E> elements, {int start = 0, int? end, int compare(E, E)?}) → void
Sorts a list between start (inclusive) and end (exclusive) using the merge sort algorithm.
minBy<S, T>(Iterable<S> values, T orderBy(S), {int compare(T, T)?}) → S?
Returns the element of values for which orderBy returns the minimum value.
nullFilteredList<T>(Iterable input) List<T>
Converts input to a List with non-null elements if T is non-null.
nullFilteredMap<K, V>(Map input) Map<K, V>
Converts input to a Map with non-null keys and values if K and V are non-null.
nullFilteredSet<T>(Iterable input) Set<T>
Converts input to a Set with non-null elements if T is non-null.
nullIfEmpty<T>(T value) → T?
Returns null if value is empty, otherwise returns value.
reverse<E>(List<E> elements, [int start = 0, int? end]) → void
Reverses a list, or a part of a list, in-place.
shuffle(List elements, [int start = 0, int? end, Random? random]) → void
Shuffles a list randomly.
stronglyConnectedComponents<T>(Map<T, Iterable<T>> graph) List<Set<T>>
Returns the strongly connected components of graph, in topological order.
transitiveClosure<T>(Map<T, Iterable<T>> graph) Map<T, Set<T>>
Returns the transitive closure of graph.
traverseMap(Map map, Iterable keys, {dynamic newValue}) → dynamic
Traverses a Map using a list of keys. If the keys do not exist, they are created. If newValue is provided, the value at the end of the traversal is set to newValue.
tryToJson(dynamic object) → dynamic
tryToMap(dynamic object) → dynamic
unique<T>(Iterable<T> src, [bool equals(T a, T b)?]) Iterable<T>
Returns a new iterable with all duplicate elements removed.
uniqueEntries<K, V>(Iterable<MapEntry<K, V>> entries) List<MapEntry<K, V>>
uniqueKeys<K, V>(Iterable<MapEntry<K, V>> entries) List<MapEntry<K, V>>
uniqueValues<K, V>(Iterable<MapEntry<K, V>> entries) List<MapEntry<K, V>>