This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have found this extension to be useful, it allows someone to skip the common for loop pattern for accessing elements. It also supersedes the need for specialized methods like
mapIndexed
,whereIndexed
, (I count 14 in this package). BUT the value seems low because technically we haveasMap
and these specialized methods alreadyBefore
After
Related issues
Lots of JavaScript developers rely on their overloadable map method which allows optionally accessing the index, so tutorials like this are created to shim this missing functionality https://fireship.io/snippets/dart-how-to-get-the-index-on-array-loop-map/
This is a common question on Stack Overflow
Entire videos on YouTube are dedicated to helping people with this
https://www.youtube.com/watch?v=HLMzibT2Wms
There are some related issues here, although admittedly they are closed
dart-lang/sdk#49589
dart-lang/sdk#33965