I want to create an Enum or Sealed class that is gonna hold the values for a DropDownMenu in order to sort a list.
In my ViewModel I have
result.data.map { it.toPresentationModel() }.sortedWith(compareBy {it.date})
Instead of compareBy {it.date}) I wanna do that inside the enum/sealed class because for other options I wanna do (compareByDescending{it.date}) and just pass here the current selected value of the DropDownMenu.
And inside compareBy() I need to pass a parameter from a Data class
And also I would like to retrieve the enum's value name to put it inside my DropDownMenu
Here's how it looks like
Is this possible? Any suggestions please?
