//https://stackoverflow.com/questions/30620546/how-to-sort-map-value import 'dart:collection'; void main() { var temp= { 'A' : 3, 'B' : 1, 'C' : 2 }; var sortedKeys = temp.keys.toList(growable:false) ..sort((k1, k2) => temp[k1].compareTo(temp[k2])); LinkedHashMap sortedMap = new LinkedHashMap .fromIterable(sortedKeys, key: (k) => k, value: (k) => temp[k]); print(sortedMap); }

flutter reorder map by key

Similar Code Examples