sort method

dynamic sort()

Implementation

sort() {
//  print("con"+this.contents.toString());
  //this.contents.sort();
  //this.contents = Map.fromEntries(
  //    map.entries.toList()..sort((e1, e2) => e1.key.compareTo(e2.key)));
 // final sorted = SplayTreeMap.from(
 //    this.contents, (key1, key2) => unsorted[key1].compareTo(unsorted[key2]));
 /* List ind=[];
  for (var content in this.contents)
    content['priority']*/
  this.contents.sort((m1, m2) {
    var r = m1["priority"].compareTo(m2["priority"]);
    if (r != 0) return r;
    return m1["priority"].compareTo(m2["priority"]);
  });

  this.sorted = true;
}