To-Do App
class ToDoItem{
final String id;
final String title;
final Color color;
final int price;
final IconData icon;
final String todoListId;
const ToDoItem({
@required this.color,
@required this.id,
@required this.todoListId,
@required this.price,
@required this.title,
@required this.icon,
});}
I am trying to find the title of the ToDoItem which has the highest price
And the ToDoItem is being added to this:
List<ToDoItem> toDo= [];
This is the code which i used in dart to sort your list . YOu could use the sorting logic from in here . it sorts your list in ascending order acc to price .