mapToListSortedByKey<T> static method
Implementation
static List<T> mapToListSortedByKey<T>(Map<int, T> map) {
// Get the keys of the map and sort them
List<int> sortedKeys = map.keys.toList()..sort();
// Create a list with values sorted by the sorted keys
List<T> sortedList = sortedKeys.map((key) => map[key]!).toList();
return sortedList;
}