toList<T> method

List<T> toList<T>(
  1. T mapFunction(
    1. K key,
    2. V value
    )
)

Function to convert the map into a List. Takes a function as parameter that defines how the key and value are mapped into T

Implementation

List<T> toList<T>(T Function(K key, V value) mapFunction) => entries.map((e) => mapFunction(e.key, e.value)).toList();