kt.dart
kt.dart copied to clipboard
A port of kotlin-stdlib for Dart/Flutter including immutable collections (KtList, KtMap, KtSet) and other packages
```dart var abc = mutableListOf(["a", "b", "c"]); final KMutableIterator i = abc.iterator(); assert(i.next() == "a"); i.remove(); assert(abc[0] == "b"); // Failed assertion: 'abc[0] == "b"': is not true. ``` `abc[0]`...
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/sum-of.html
https://kotlinlang.org/docs/whatsnew15.html#new-collections-function-firstnotnullof
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/scan.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/running-fold.html
KtList (and others) has no const factories with const initializers. For example, KtList.of(1, 2, 3). And therefore no available pass constructed list with const to const constructors: ``` class State...
`KMutableEntry.setValue` doesn't change the underlying collection. Here is a valid test which is currently failing ```dart final pokemon = mutableMapOf({ 1: "Bulbasaur", 2: "Ivysaur", }); pokemon.entries.forEach((entry) { entry.setValue(entry.value.toUpperCase()); }); //...
See https://github.com/passsy/kt.dart/issues/186#issuecomment-1264473741
Shouldn't all of these work? ```dart class A {} class B implements A {} // Works fine... listOf(A()).minus(listOf(B())); // _TypeError (type 'A' is not a subtype of type 'B' of...