dartx icon indicating copy to clipboard operation
dartx copied to clipboard

Add positional `isAscending` to sortedBy

Open arthurbcd opened this issue 3 weeks ago • 5 comments

sortedBy is one of the best extensions of dartx.

SortedList class allows us to sort, and uses the internal order int to decide whether it is ascending or not.

This PR simplifies this process so we can simply decide it based on isAscending positional boolean in the sortedBy extension.

This is useful, because without it, we would have to do additional operations bringing either more boilerplate or additional computations. By adding this positional boolean we can make it straightforward.

  • Added tests ✅
  • Retrocompatible ✅
  • Not a breaking change ✅

arthurbcd avatar Jun 19 '24 15:06 arthurbcd