Answers for "flutter dart sort list of objects"

0

flutter dart sort list of objects

objects.sort((a, b) {
  return a.value['name'].toString().toLowerCase().compareTo(b.value['name'].toString().toLowerCase());
});
To reverse it you could do b.someProperty.compareTo(a.someProperty). Or sort it and then use .reversed
Posted by: Guest on March-17-2022

Code answers related to "flutter dart sort list of objects"

Code answers related to "Dart"

Browse Popular Code Answers by Language