Comments (22)
I have the same problem, i'm using version 3.1.0. Is there a solution for it?
from grouped_list.
Thanks @Dimibe v3.3.0 is much better!
I fixed the ordering issue by setting sort to false on GroupedListView.
The only other issue I see is that the header on the list is still visible below the sticky group header which creates an overlap but I guess this was the sacrifice that you had to make in order to not rebuild the list when the header changes.
from grouped_list.
@kinex Do you have set the option useStickyGroupSeparators
to true
in the version 2.3.1?
This option is by default active since version 3.0.0 and I think thats where the performance issues comes from. So workaround might be to set this option explicitly to false
in verison 3.0.0.
I'am working on a fix and let you know when I have any updates on this.
Thanks for your help.
from grouped_list.
This option is by default active since version 3.0.0 and I think thats where the performance issues comes from. So workaround might be to set this option explicitly to
false
in verison 3.0.0.
I think it's better to have it as false
by default, Dimibe. Now people will be forced to add one line for the feature they don't want.
from grouped_list.
Thanks for your quick response. I am not setting it to true
in 2.31. I will try your suggested workaround soon.
from grouped_list.
I noticed a similar issue in my app that was using Grouped List 2.3.0, and setting the useStickyGroupSeparators
value to false
fixed my performance issues. But, without this setting, how can i get sticky headers?
I tried updating to 3.1.0 and am getting basically the same results where if i have it set to true, it causes performance issues when scrolling.
from grouped_list.
Upon further looking, it looks like what's happening is every time the sticky header changes (as i scroll down, if currently on "A", when the "A" tries to change to "B", which assuming is changing state) makes some child widgets in my grouped list widget rebuild. Those child widgets use provider to manage and track their state.
from grouped_list.
I am not sure if this is related but I am using 3.1.0 with useStickyGroupSeparators set to true and two items in my list of about 50 items are swapping positions. I can see the text constantly swap between the two while I scroll. The performance is a lot better if I disable useStickyGroupSeparators but I really want it. Thanks for all of your work so far.
With useStickyGroupSeparators set to false, the same two elements that were swapping positions are permanently swapped into the incorrect position. They are the 4th (index 3) and 9th (index 8) items in the 11th group (index 10). The live swapping was happening on both iOS and Android with useStickyGroupSeparators set to true, but with it set to false the permanent swap only happens on Android. Tested on 2 iOS and 2 Android devices.
Edit: scratch that... it's happening on both iOS and Android. Some really odd behaviour... on each device the items are in the correct order in one orientation but if I switch the orientation of the device the items swap.
from grouped_list.
I have the same problem, when useStickyGroupSeparators set to true two elements that were swapping positions.
from grouped_list.
Version 3.2.0 has just been released.
Performance issues:
There should be an increase in performance, since the widget is now only rebuild when necessary and not all the time.
Please let me know if there are still performance issues. I'm working on further performance improvements but this fix maybe should fix some of the issues.
Items swapping:
Problems with items swapping positions may occure when items are equals in aspects of comparison but display different values. The widgets sorts the items internally, so different items in terms of their builded widget should also clearly distinguish when sorted/compared.
from grouped_list.
I still have that issue, also with the new version 3.2.0.
from grouped_list.
@ermand-hoxha Performance Issues or the issue with the items being swapped?
from grouped_list.
Performance issue
from grouped_list.
I see a performance improvement, but I have a problem when the header items swapped.
How to fix this?
from grouped_list.
@allanwolski Like I mentioned this problem most likely comes from your elements not being sorted correctly. Please make sure your items are being sorted according their display value or sort them yourself and disable automatic sorting with the option sort: false
in the list.
from grouped_list.
I have created another package which depends on the scrollable_positioned_list because this was a highly requested feature.
Due to the underlying structure I think the package has better performance as well. If some of you want to try it out, here is the link: https://github.com/Dimibe/sticky_grouped_list.
from grouped_list.
I've tried that Sticky Grouped List, which is very identical in setup to Grouped List, and I am still seeing performance issues on a Flutter web project. Mobile is fine, but may have the same issues, although less noticeable because it's a small render.
The issue is that i have a grouped list view, and within each row (aka client), i access some state from Provider about the number of projects that client has. I notice that as i scroll down the page, and it comes to a new sticky header, it rebuilds the state or something which makes the page scroll lag because it's rebuilding the state for that count number for each row under that sticky header it just entered.
Perhaps this can be fixed in this package, or perhaps I have an improvement to make in how I am handling the state, or perhaps i can tell the sticky grouped list widget to not re-build that state on that child component on each row.
from grouped_list.
Just tested 3.2.3 and useStickyGroupSeparators is still unusable. Performance is a littler better but there is still noticeable lag when the sticky group separate is changing.
The issue with items swapping still persists. The items are order correctly. New in 3.2.3, the items now swap live while scrolling when the sticky group separator is changing. This only happens with useStickyGroupSeparators set to true. It works perfectly otherwise.
The sticky_grouped_list package has the exact same issues.
from grouped_list.
@zanesc
When set useStickyGroupSeparators
to true
the list package the items internally. This is done by comparing the groupBy
value of the elements and the elements itself. If the items are swapping that is because either the sorting of the groupBy
values or the elements is not consistent. If thats the case each time the widget rebuilds the order may change.
To fix this you need to fix your code so that the sorting is clear. Here you can find the sorting code of the widget to check on yourself.
Currently I see no possibility to change the prevent the widget from rebuilding when the sticky header changes.
Thats also the reason why the swapping of your items only occur with the sticky headers, because the rebuild is only needed to change them.
from grouped_list.
@Dimibe The elements are ordered correctly. The categories are ordered by a categorySortOrder int and there are no duplicates, and the items are ordered by a sortOrder int with no duplicates within their respective categories.
This isn't an issue for me as I would not be using the stickyGroupSeperators because of the noticeable lag when the sticky headers change. I haven't taken a look at your code but are you sure there is no way to separate the sticky header widget from the list widget such that only the sticky header widget rebuilds when necessary and not the list widget?
Maybe @danilonogueirateixeira can shed some light on their case to confirm that their elements are ordered correctly as well. If you'd like me to I can create a new issue for this to track any other users who may be having the same issue.
If I get the time I will create a project to reproduce the issue to share with you, but I can't at the moment.
from grouped_list.
Performance issues fixed in version 3.3.0
@zanesc Thank you for your detailed explanation. I released a new version 3.3.0 where the list does not rebuild when the sticky group header changes. With that I expect the performance issues to disappear. Therefore I have closed this issue.
For the issue with the changing order please create a new issue if still present. It would appreciate a small example with shows the issue because I was not able to reproduce it.
from grouped_list.
Thanks so much for fixing this! The performance is much better using 3.3.0!
from grouped_list.
Related Issues (20)
- order getting wrong after 33th index HOT 1
- Side effect of GroupedListView HOT 3
- Suggestion: ItemCount for adding extra widget HOT 4
- Is it possible to put a message when no data HOT 1
- GroupedListView not working with getX HOT 3
- Scroll to Element HOT 9
- [Performance] Too many repaints while scrolling HOT 1
- Group header builder should get the group no just the first element
- count total item HOT 1
- first item visibility change also changes the first group item to second one
- sticky group separator not working properly
- How to add rounded corners at the bottom? HOT 1
- if there are more than 33 elements list order messed up HOT 8
- Group separator does not change background on dark mode
- how i can get index of group separator
- Can this implement a chat like list ? HOT 1
- Is there a way to get the index of an item inside the group? HOT 2
- A GlobalKey can only be specified on one widget at a time in the widget tree. HOT 1
- Is there a way to draw a widget at the end of the last item? HOT 1
- Can separator be set to null? Because after setting itemExtent, the height doubles
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grouped_list.