Dart Map each element in the collection
All collection objects contain a map method that takes a Function as an argument, which must take a single argument. This returns an Iterable backed by the collection. When the Iterable is iterated, each step calls the function with a new element of the collection, and the result of the call becomes the next element of the iteration.
You can turn an Iterable into a collection again by using the Iterable.toSet() or Iterable.toList() methods, or by using a collection constructor which takes an iterable like Queue.from or List.from.