dart sort list of object code example
Example: flutter sort list by object property
List<Transaction> get sortByHighestTransactions {
transactions.sort((txn1, txn2) => txn2.amount.compareTo(txn1.amount));
return transactions;
}
List<Transaction> get sortByHighestTransactions {
transactions.sort((txn1, txn2) => txn2.amount.compareTo(txn1.amount));
return transactions;
}