Dimibe / grouped_list

A Flutter ListView in which items can be grouped into sections.
https://pub.dev/packages/grouped_list
MIT License
395 stars 106 forks source link

Order By issue with 10th,1st... #123

Closed KlubAndroid closed 2 years ago

KlubAndroid commented 2 years ago

Hello, I have list of Strings from db like this ( 1st... ,2th,3th,4th..10th... ) group by give me result (10th,1st,2th...) way to correct this in sql db is "columName*1" then will return correct order , How to do that in Group_by? example list: List _elements = [ {'name': 'Miranda', 'group': 'Team B'}, {'name': 'Mike', 'group': 'Team C'}, {'name': 'Danny', 'group': 'Team C'}, {'name': 'Danny', 'group': 'Team D'}, {'name': 'John', 'group': '1st Team A'}, {'name': 'John', 'group': '10th Team A'}, {'name': 'John', 'group': '9th Team A'}, {'name': 'John', 'group': '8th Team A'}, ];

Dimibe commented 2 years ago

Hello @KlubAndroid, this package gives you the ability to order and group your list in any way you like. You can implement your own function for grouping and ordering. So you don't have to rely on the default alphabetical ordering. For your specific usecase it seems so that you need change the alpha-numerical ordering such that numbers are behind letters.