Skip to content

Instantly share code, notes, and snippets.

@marcinOz
Last active June 10, 2020 18:21
Show Gist options
  • Save marcinOz/2adc528752989f0417431618e4243d36 to your computer and use it in GitHub Desktop.
Save marcinOz/2adc528752989f0417431618e4243d36 to your computer and use it in GitHub Desktop.
extension ListExt<T> on List<T> {
List<T> copy() => List.from(this, growable: true);
List<Y> mapIndexed<Y>(Y Function(T, int) onMap) =>
asMap().entries.map((entry) =>
onMap(entry.value, entry.key)).toList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment