flutter sort list of objects code example
Example 1: sort a custom list flutter
someObjects.sort((a, b) => a.someProperty.compareTo(b.someProperty));
Example 2: flutter sort list by object property
List<Transaction> get sortByHighestTransactions {
transactions.sort((txn1, txn2) => txn2.amount.compareTo(txn1.amount));
return transactions;
}