Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order Descending Grouped Dates #106

Closed
saguado69 opened this issue Jun 6, 2021 · 6 comments
Closed

Order Descending Grouped Dates #106

saguado69 opened this issue Jun 6, 2021 · 6 comments

Comments

@saguado69
Copy link

Hi,

My code was runnning ok with previous versión of 4.0.0. After upgrading I lost scending ordenring of the groups. Items still ordenring descending but not the groups. If I only order by MMM yyyy is ok but if I order by dd MMMM yyyy then the groups order does not work. I have tryied differents combination with comparator but not succeed.

GroupedListView(
                      key: const Key('changeLogGroupedList'),
                      elements: logItems,
                      floatingHeader: true,
                      addAutomaticKeepAlives: true,
                      useStickyGroupSeparators: true,
                      groupBy: (dynamic logItem) => DateFormat('dd MMMM yyyy')
                          .format(logItem.createdAt.toDate()),
                      groupComparator: (value1, value2) =>
                          value2.compareTo(value1),
                      itemComparator: (item1, item2) =>
                          item1.createdAt.compareTo(item2.createdAt),
                      order: GroupedListOrder.DESC,
                      groupSeparatorBuilder: (dynamic logItem) => SizedBox(
@DineshKachhot
Copy link

I have the same kind of issue using grouped_list, I am not able to order groups by date.

@DineshKachhot
Copy link

My issue is fixed: if you are displaying an ordered list, you can disable sorting of GroupedListView like sort: false.
I am not sure it will help any one, but sharing here as it worked for me.

@nifhanif
Copy link

nifhanif commented Jun 9, 2022

Thank you... it work

My issue is fixed: if you are displaying an ordered list, you can disable sorting of GroupedListView like sort: false.
I am not sure it will help any one, but sharing here as it worked for me.

@Dimibe
Copy link
Owner

Dimibe commented Jun 15, 2022

Seems to be solved

@Dimibe Dimibe closed this as completed Jun 15, 2022
@waqadArshad
Copy link

My issue is fixed: if you are displaying an ordered list, you can disable sorting of GroupedListView like sort: false. I am not sure it will help any one, but sharing here as it worked for me.

Thanks a lot @DineshKachhot

@lakoliu
Copy link

lakoliu commented Nov 19, 2022

Thank you, @DineshKachhot, that was just what I needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants