Dart - How to sort Map's keys

dart

Solution

If you want a sorted `List` of the map's keys:

var sortedKeys = map.keys.toList()..sort();

You can optionally pass a custom sort function to the `List.sort` method.

Finally, might I suggest using `Map<String, dynamic>` rather than `Map<String, Object>`?

Problem

I have question in sorting Map's key in Dart. ``` Map<String, Object> map = new Map(); ``` How can I sort the keys in map? or Sort the Iterable map.keys.

Original source

Related problems