collection
collection copied to clipboard
The collection package for Dart contains a number of separate libraries with utility functions and classes that makes working with collections easier.
### Proposal It would be nice if we support the non linear data structures like: trees and graphs. ### Problem I have been searching for the binary tree, but unfortunately...
Example ```dart ["1", "2", "", "4", "@"].mapNotNull(int.tryParse) -> (1, 2, 4) ``` https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/map-not-null.html #180
Could you implement `anyIndexed` and `everyIndexed` please? ```dart extension IterableExt on Iterable { bool everyIndexed(final bool Function(int i, E e) test) { var index = 0; for (final element in...
Ref: https://github.com/dart-lang/sdk/issues/7775 ```dart extension IntRange on int { /// A arithmetic sequence of numbers from [this] to, but not including [end]. /// /// The difference between two consecutive numbers is...
Could be nice to add const UnmodifiableListView.empty() constructor in the same way as UnmodifiableMapView.empty() constructor had been added: https://github.com/dart-lang/collection/issues/20
After switching to null safe, am getting this error when i try grouping **_the method '[]' can't be unconditionally invoked because the receiver can be null_** my code `Map newMap...
How about adding an example of how to use the equality checker classes? ``` final bool contentsEqual = (const ListEquality()).equals(list1, list2); ``` ``` @override bool operator ==(Object other) => (other...
# CanonicalizedMap.cast() throws _CastError ## Example: ```dart try { var sourceMap = {'a': 'A'}; var canonicalized = new CanonicalizedMap.from(sourceMap, (String key) => key.toLowerCase()); var badResult = canonicalized.cast(); var goodResult =...
There is a repeating feature request in Flutter to add separators for children of Row and Column: https://github.com/flutter/flutter/issues/16957 https://github.com/flutter/flutter/issues/18917 https://github.com/flutter/flutter/issues/55378 https://github.com/flutter/flutter/issues/95263 https://github.com/flutter/flutter/issues/95521 At its highest it got 117 thumbs-ups. But...
add a extension function `getOrNull(int index)` on List to get element at the specified index safely. If out of bounds, return null. It can work well with nnbd. ref: [https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/get-or-null.html](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/get-or-null.html)