You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you implement anyIndexed and everyIndexed please?
extensionIterableExt<E> onIterable<E>
{
booleveryIndexed(finalboolFunction(int i, E e) test)
{
var index =0;
for (final element inthis) {
if (!test(index, element)) returnfalse;
}
returntrue;
}
boolanyIndexed(finalboolFunction(int index, E element) test)
{
var index =0;
for (final element inthis) {
if (test(index, element)) returntrue;
}
returnfalse;
}
}
The text was updated successfully, but these errors were encountered:
darkstarx
changed the title
ListExtensions needs anyIndexed and everyIndexed
Need IterableExtension<E> with anyIndexed and everyIndexed
Apr 16, 2022
There is now an indexed extension getter on Iterable in the platform libraries. You can do someIterable.indexed.any((iv) => indexTest(iv.$1) && valueTest(iv.$2)).
I hope to get better syntax for destructing f directly in the parameter list in the future.
Could you implement
anyIndexed
andeveryIndexed
please?The text was updated successfully, but these errors were encountered: