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
Both of these functions are actually on Iterable, and inherited through List.
It is possible to have an Iterable without a definitive length (or index, of any sort). For example, imagine a virtual-scrolling list. Of course, it is very easy to write such functionality yourself, if you'd like:
voidforEachIndex<T>(Iterable<T> elements, voidFunction(T, int) forEach) {
var i =0;
for (final element in elements) {
forEach(element, i++);
}
}
voidexample(Iterable<String> elements) {
forEachIndex(elements, (e, i) {
});
}
You might also find following this useful: #9991, then you'd do:
No description provided.
The text was updated successfully, but these errors were encountered: